Open form on two criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a form that contains an amount field and a combo box which has three
letter codes:
For example i have three codes...
RRM
RFD
RMY--------Once user selects RMY.....i would like form LowVal form to be
opened up.Should the user enter an amount greater than 20,000 in the amount
field then the Exempt form should open up.I see in the after update a
selection of expression builder, code
builder and macro builder...How do i build this expression to apply so if
either of these criteria has been met, one of these forms would
automactically open up?
Thanks for your support....
 
JK,

In the AfterUpdate event property of the Letter Code combobox, select
'Event Procedure', and then click the little ellipsis (...) button to
the right to open the VBE window. Type the equivalent of this (I have
assumed your combobox is called [Letter Codes])...

Private Sub Letter_Codes_AfterUpdate()
If Me.Letter_Codes = "RMY" Then
DoCmd.OpenForm "LowVal"
End If
End Sub

Similarly for the Amount textbox...

Private Sub Amount_AfterUpdate()
If Me.Amount >20000 Then
DoCmd.OpenForm "Exempt"
End If
End Sub
 
Back
Top