Results 1 to 11 of 11
  1. #1
    bonnielynnw is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2016
    Location
    Howland, Maine
    Posts
    15

    Macro Error on Open from Windows to Microsoft 365

    Please forgive my description but hope it makes sense. I created a DB in Access 2007 on a Windows 10 PC 4 yrs ago. Now there's a new PC, has Microsoft 365 for 1. When I copy my DB to new PC and open, welcome form opens fine but when I select my data entry form to open I get an error "The control name 'VetIdNumber' is misspelled or refers to a control that doesn't exist." Click OK I get msg box Error 32004 Macro name: mShowHideSourceInfo Action Name: SetProperty Arguments: VetIdNumber, 1, -1 If I click on Stop All Macros, the form opens anyway and functions just fine. Another thing I noticed is that when I first opened the DB file I got a yellow bar under the toolbar saying something about somethings may not work right and I selected Enable. Is there something more I need to do? When I close and reopen, it's no longer there but still get the macro error when I open the data entry form. A note about that data entry form. It opens to add new and you type in a date, then a Source: Vet, Customer, Shelter and depending upon which you choose, the fields on my form specific to each appear (on open they are all visible=no). I noticed in the macro that I can convert macros to VB. Will that possibly help?

    Thank you to each and every one of you who help out with these things!!!!!!!

    P.S. I converted the macro to VB but now not sure how to "Run" it...not sure what to write in the event line 'on current'

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    You copied to a non-trusted location hence the yellow bar. I only copy to trusted location so I can't tell you if it's trusted now by saying OK once. You can check in the db properties - look for Trusted Locations and compare the path to your db and see if it is one now.
    Converting code will not fix the error. Something is looking for that field or control name and it can't be found. Could be a spelling mistake, could be that it was never there and earlier version didn't choke on it. I see a lot of such sudden errors when switching OS or Office versions - they tend to be less forgiving. You will have to look to find the missing item. Could be on a form that's opening, could be misspelled in the macro, could be in a query that some form is bound to, could be in code, could be in a control expression (e.g. txtMyTextbox has an expression like = NameOfMissingControl.

    If you remain stuck, you could copy your db, compact it, zip and post it here. Most of us don't use macros beyond maybe AutoExec so anything you post about that might not help a whole lot.
    Last edited by Micron; 12-12-2020 at 03:15 PM. Reason: added info
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    bonnielynnw is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2016
    Location
    Howland, Maine
    Posts
    15
    Hi there! Thank you very much for your reply. The new PC was my new PC. So definitely trusted. However, I have tested EVERY other form and report and ONLY this one form errors. Even if I removed all events when it opens, I still get that error. Another form, Click Here To Create Certificates, also has the VetIdNumber field and it works fine. I have, I hope, successfully compressed and zipped the file. Nope, got an error. I'm going to restart my PC and reply again and try to attach the file. It's just 7100 kb and compressed its only 800 some odd. I'll be back! (I didn't want to have to retype the prior info.)

  4. #4
    bonnielynnw is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2016
    Location
    Howland, Maine
    Posts
    15

    Argh!

    It says 7z is not valid. I'll have to find another way to compress.

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Just right click the file and Send to Zipped Folder ?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    bonnielynnw is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2016
    Location
    Howland, Maine
    Posts
    15

    OMG! I think I did it! Compressed file is attached...

    Whew, had to strip out lots of stuff and leave the bare minimum to get file size down. The purpose of this form is to key in the data to the fields and when you get to Source field, your selection determines which fields are visible or not. It's always worked. I've tried deleting and reinserting the field. Everything else in the DB works perfectly fine. Even if I deleted all Events on this form the error still comes. Tried to convert it to VB but don't know how to run it.

    Thank you in advance for anything you can do to illuminate me on why this is happening and how to fix it. Otherwise I'll have to create a main form that then opens a totally separate form when you select Source.
    Attached Files Attached Files

  7. #7
    bonnielynnw is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2016
    Location
    Howland, Maine
    Posts
    15
    Thank you very much. Not a skilled PC user these days. I was trying to zip to a 7-Zip and no luck, but thank you so much for the direction. It worked! Had to strip lots out to make smaller but Hooray!

  8. #8
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    7zip can zip as .zip.

    Your problem is this: subforms load first. Your vet subform is calling the macro in the current event and this form does not contain the referenced control. I suppose you could put a copy of it there and never show it on that form, or don't call the macro in any subform form event. Or don't use macros. I may seem uncertain as to how you should fix this, which is true because I don't use macros.

    For future, how you find such a problem is this: Copy the form and allow "copy of" as part of the name. Keep removing things in the original form until it no longer raises that error. If it raises another error, remove the offending item(s) as well. When the original error ceases, you've found the culprit and you still have a copy of the original.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    bonnielynnw is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2016
    Location
    Howland, Maine
    Posts
    15
    Hi there Micron!

    Thank you very much for your input. It actually gave me the idea of how to stop the error. The field VetIdNumber already has a list of the vets to select from so I really did not need the subform as it was not linked, just the tVets. I removed the vet subform, deleted the macro steps for the Show/Hide buttons and all references to the subform visible yes/no. Now it works again!

    Hugs!

    Bonnie

  10. #10
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Glad you were able to fix it to your satisfaction. Good luck with your db!
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #11
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by bonnielynnw View Post
    .... The new PC was my new PC. So definitely trusted......
    I think you misunderstand what Trusted means in this instance. It does not mean the computer is unknown or not trusted (even though it is your computer). It means Access does not trust the LOCATION the database is being opened from. So access disables Macros and VBA code, unless you click the "Enable Content" or you move the dB to a trusted location (as defined by the Trusted Locations dialog box).

    Click image for larger version. 

Name:	Trusted1.png 
Views:	7 
Size:	92.3 KB 
ID:	43682

    Click image for larger version. 

Name:	Trusted2.png 
Views:	7 
Size:	22.3 KB 
ID:	43683
    As you can see, I have several "Trusted Locations" for Access databases.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 08-08-2018, 09:43 AM
  2. Replies: 2
    Last Post: 09-11-2017, 01:10 PM
  3. Microsoft Access 2010 Runtime on windows 8
    By Guy Tal in forum Access
    Replies: 1
    Last Post: 02-16-2014, 10:59 AM
  4. Replies: 12
    Last Post: 02-09-2012, 02:27 PM
  5. Replies: 0
    Last Post: 10-13-2010, 03:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums