Zydeceltico
Registered User.
- Local time
- Today, 17:17
- Joined
- Dec 5, 2017
- Messages
- 843
Form1 has a command button that opens Form2.
Form2 has two buttons on it,
I want one of the buttons to be invisible when Form2 opens.
Here's the code:
It doesn't work. ......in a weird way.............Form2 opens, both buttons are visible, I enter a bunch of data, then I click to save and when Form2 closes I get error 2450: Access cannot find the referenced form 'frmLineStop.' I click Debug and it takes me to the code I've pasted above with the second line of code highighted yellow.
It's like it has waited until the form closes to run the second line of the OpenForm code - - or something.
Anyway.........I use this same exact code on a different form but the exact same setup and procedure and it works fine. I;ve checked spelling, copied and pasted. Making me nuts.
What are you able to see that I cannot?
Thanks!
Tim
Form2 has two buttons on it,
I want one of the buttons to be invisible when Form2 opens.
Here's the code:
DoCmd.OpenForm "frmLineStop", acNormal, , , acFormEdit, acDialog, Me.txtInspectionEvent_PK
Forms![frmLineStop].[cmdAddtlNotes].Visible = False
It doesn't work. ......in a weird way.............Form2 opens, both buttons are visible, I enter a bunch of data, then I click to save and when Form2 closes I get error 2450: Access cannot find the referenced form 'frmLineStop.' I click Debug and it takes me to the code I've pasted above with the second line of code highighted yellow.
It's like it has waited until the form closes to run the second line of the OpenForm code - - or something.
Anyway.........I use this same exact code on a different form but the exact same setup and procedure and it works fine. I;ve checked spelling, copied and pasted. Making me nuts.
What are you able to see that I cannot?
Thanks!
Tim