PDA

View Full Version : How do I resolve this error message on a yes/no drop down menu using a vba sub proc?



wedd
09-23-2010, 12:54 AM
Hi experts, I've created a drop down menu yes/no with pop-up messages, but the following error message appeared...any reasons why this has happened...and is there a solution to this problem, so when i click on the drop down menu on either yes or no it will display the pop-up message with the following error message appearing?

The expression After Update you entered as the event property produced the following error: Only comments may appear after End Sub, End Function, or End Property.


* This expression may result in the name of a macro, the name of a user-derfined function, or [Event Procedure].

* There may have been an error evaluating the function, event, or macro.

I then opened the help feature on access and the following message was displayed:

This error occurs when an event has failed to run because Microsoft Office Access cannot evaluate the location of the logic for the event. For example, if the OnOpen property of a form is set to =[Field], this error occurs because Access expects a macro or event name to run when the event is fired.




Many thanks:clap:

Movian
09-23-2010, 07:29 AM
Only comments may appear after End Sub, End Function, or End Property.


thats the important part.

so from that you can deduce that somewhere your end sub, end function or end property lines are missing or messed up.

review your code and check them

Imdabaum
09-23-2010, 07:29 AM
Make sure that your codes are all contained Function-End Function; Sub... End Sub.

If anything appears after the End Sub/Function that isn't commented or isn't another sub/function you will get that error.

wedd
09-23-2010, 07:49 AM
thanks