Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

msgbox for yes/no combo box. 1

Status
Not open for further replies.
Aug 4, 2004
84
US
I know this is elementary but I am trying to get a message box to appear when a user selects yes. I have tried:

If (controlsourcename) = "yes" Then
MsgBox "Do you need approval?"
End If

i have placed in after update....what am i doing wrong? be nice, thanks!

ab
 
If you have placed your bit of code in the after update event for the combo box then I see no reason why it should not work unless you are not refering to the (controlsourcename) correctly.

is the row source property for the combo box "yes";"no" and row source type value list?

if everything seems ok post the actual bit of code for further scrutinisation.

HTH Savil
 
If (RevenueDeferred) = "yes" Then
MsgBox "Do you need approval?"
End If

I get "a cant find macro............." Row source type is value list and row source property is yes, no.

 
don't like the brackets try

If me.RevenueDeferred = "yes" Then
MsgBox "Do you need approval?"
End If
 
I have just managed to reproduce your error by going to the form in design view, selecting the combo box and going to its properties. On the after update event I copied your code directly on to that line, Is this what you have done? Please forgive me if I have assumed your knowledge of Access is way less than what it is.

If this is the case when you select the after update line click on the button with down arrow on it and select event procedure now click on the button with the three dots and you will be taken to a module window. In between the two pre-filled out lines copy the code that I posted, close the window and try again.

Savil
 
hey thanks, works. I actually have a pretty good understanding of Access, and have put together a pretty nice DB at work. The problem is i get into is simple coding, never liked it, never will. And I have forgot mostly everything from school. But something tells me that I will need to freshen up or keep getting frustrated. I'll stop babbling...

thanks again.

ab
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top