Open Forms Using Parameter Query

  • Thread starter Thread starter AR
  • Start date Start date
A

AR

I use a switchboard to allow users to open a form based on
a parameter query; the parameter query requests a product
batch number which users enter and the form opens pre-
filled with the batch details. I now want to change this
so that the form that opens will depend on the batch
number supplied by the user. e.g for batch numbers
<100,000 I want Form A to open and for batch numbers
100,000 I want Form B to open. Any help appreciated.

TIA
 
Well, assuming you have a textbox where the user can enter
a cutoff batch number and you have a button that fires an
event that does the decision making:
Sub cmdGo()
If Me.txtBatchNum < 100000 Then
DoCmd.OpenForm "FormA"
ElseIf Me.txtBatchNum >= 100000 Then
DoCmd.OpenForm "FormA"
End if
End Sub

Hopre that helps.
Geof.
 
Works perfect! Thanks

-----Original Message-----
Well, assuming you have a textbox where the user can enter
a cutoff batch number and you have a button that fires an
event that does the decision making:
Sub cmdGo()
If Me.txtBatchNum < 100000 Then
DoCmd.OpenForm "FormA"
ElseIf Me.txtBatchNum >= 100000 Then
DoCmd.OpenForm "FormA"
End if
End Sub

Hopre that helps.
Geof.
.
 
Back
Top