Open form on two criteria

J

jk

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....
 
S

Steve Schapel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top