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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Value Msgbox

Status
Not open for further replies.

Mr2006

Technical User
Jun 21, 2006
80
0
0
US
Hello,

I have a combobox that have yes and No value. The row source is Value List. The name of the combo is shippingneeded

I want a message box to pop if someone chooses yes. The msg will be “Call shipping dept at 222.” If no, then nothing happen.

I truly value your suggestions!!
 
Have you tried something as simple as this in the after update event?

Code:
Private Sub shippingneeded_AfterUpdate()

if me!shippingneeded="yes" then

   msgbox("call blah de blah")

endif

end sub

JB
 
It worked perfectly. But one problem is that he combo can be left blank which will not work. If the purchase date is not null, making a choice in this field must be mandatory.

Thanks

 
a) Set the default of the combo to ="No". That way the user only changes it if required and gets the message.

b) Add in validation rule "is not null" (no quotes!)

c) Add validation text to "You must enter yes or no for shipping" so the user cannot proceed even if they delete the default entry to try and leave it blank...

JB
 
or, to keep your current combobox setup:
Code:
[blue]   If Trim(Me!ShippingNeeded & "") <> "" Then
      If Me!ShippingNeeded = "Yes" Then
         MsgBox "Call shipping dept at 222."
      End If
   End If[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top