msgbox in access

Hi there

this is what I want to do

I am creating a form in an access database on which is a drop down box.  

When a user selects a certain option from the drop box I want it to display a message.

Is this simple to do?

Thanks
heijmerAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Commented:
you have to change the name of the combo0 to your actual combo box name and "some options" to the option you want...

you can also, display different messages depending on the options you select

private sub combo0_afterupdate()

select case me.combo0
   case ="option1"
   msgbox "Hello 1"
   case ="option2"
   msgbox "Hello 2"


end select

end sub
0
 
Rey Obrero (Capricorn1)Commented:
yes,

private sub combo0_afterupdate()

if me.combo0="some options" then
   msgbox "Hello"
end if

end sub
0
 
heijmerAuthor Commented:
Thanks - tried that but when I switch back to form veiw and select the item on the list that I want to generate a message

nothing happens

Code:

Option Compare Database

Private Sub combo0_afterupdate()

If Me.combo0 = "Issue Around Cost" Then
   MsgBox "Have you found out if the customer could be pursuded by a 10% Discount?"
End If

End Sub

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
heijmerAuthor Commented:
where do i find the name of the combo box???
(sorry if that sounds stupid!)
0
 
heijmerAuthor Commented:
where do i find the name of the combo box???
(sorry if that sounds stupid!)

is this correct?
0
 
heijmerAuthor Commented:
where do i find the name of the combo box???
(sorry if that sounds stupid!)

is this correct?

Option Compare Database

Private Sub combo0_afterupdate()

If Me.Outcome = "Issue Around Cost" Then
   MsgBox "Have you found out if the customer could be pursuded by a 10% Discount?"
End If

End Sub

0
 
Rey Obrero (Capricorn1)Commented:
in the design view of the form, select the combo box and hit F4

select the Event tab, locate the After Update event and click on the Dropdown arrow to the right and select {Event Procedure]
then click on the (...) , this will take you to the VBA window wher you will place the codes

If Me.combo0 = "Issue Around Cost" Then
   MsgBox "Have you found out if the customer could be pursuded by a 10% Discount?"
End If


again, you need to change "combo0" to the name of the combo box
0
 
heijmerAuthor Commented:
Fantastic - thats really great.

One more thing is there a way that you maximum the msgbox so it take up the whole screen?

Thanks buddy
0
 
Rey Obrero (Capricorn1)Commented:
No, the message box is dependent on the amount of message you want to display but it has its limitations too.
0
 
Rey Obrero (Capricorn1)Commented:
you can create own "message Form"  to show the message and maximize it on open, but it is not advisable
0
 
heijmerAuthor Commented:
Ok thanks for all your help - 500 points coming your way!!!!!!!!!!!!!!!!!!!!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.