A Very taxing Problem!

DJ100

Registered User.
Local time
Today, 14:03
Joined
Jul 4, 2002
Messages
34
Has anyone any idea how to open a form in VBA based upon an If statement??? Basically I want to open a form when I get a certain answer in a combo box! I have no probs opening a form after updating a text box but I cannot limit it to only open when a certain answer is given! ANY IDEAS?????????
 
OK, say you have a combo box called cboGuessTheNumber that has a Row Source Type of ValueList, and a Row Source of 1;2;3;4;5.

In the AfterUpdate event for cboGuessTheNumber, choose [Event Procedure] and click the build [...] button. In the space between the "Private Sub..." line and the "End Sub" line type

If me.cboGuessTheNumber= 4 then docmd.OpenForm "frmYouWin"

(The number 4 is the "winner", and if the user selects it, the form named frmYouWin will be opened.)
 

Users who are viewing this thread

Back
Top Bottom