Hello -
I have a section of my VBA which has stopped working and I'm hoping someone can help me troubleshoot. All other Macros and code work fine inside this database.
I have code in this section of a form:
It doesn't error our, however it doesn't run either. It seems as if something was turned off where it won't recognize any code inside that section.Private Sub Form_Open(Cancel As Integer) MsgBox ("Welcome!") DoCmd.Maximize End Sub
Have you tried erasing the code. Closing the Form and saving it. Open the form and re-enter the code. Sometimes, Access does some strange things. Also before you do the above, consider running Repair and Compact.
Alan
Alan
Click the * below to say thanks.
Database Principles
Pivot Table Tips
Good Excel Video Tutorials
Sumifs or SumProduct
DataPig Access Tutorials
MS Query Tutorial
Worst Pie Chart Ever?
In my experience when this happens, it is because the forms properties looses the event procedure tag.
Check the following:
Open the form in Design View
Before Clicking Anything on the form pull up the forms properties window.
Click the Event Tab
Find the "On Load" line - Select the "..." button to the right, and click "Code Builder" then click ok.
This should open the VB Window, click the save button to save your db at this point.
Close the form, reopen it and it should work again.
These Directions are based on Access 2007, however there are very similar steps in almost all versions. For whatever reason I have had this happen to me 20 times or so in the last year while doing various test runs on code in the intermediate window. Wish I knew the reason why.
Hope this helps,
Dan
"I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
If my advice has been helpful to you, then please help me by clicking on the "Star" and adding to my reputation, Thanks!
Make sure that, in the form design properties, the "On Open" property still says: [Event Procedure]
Cheers,
“To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks