RANDALL R ANTHONY
RRANTHON at sentara.com
Sat Jan 26 13:12:21 CST 2008
Greetings,
Im vexed by a problem Im having with a form. A97.
On form A, I have a Do.Cmd etc, and passing an openarg value of 1 or 2.
On form B, I have an on load event to evaluate the openarg and set the recordsource. This is obviously not working as the form opens with all the records displayed. If I set the recordsource in the properties window, it works fine. What am I missing? TIA.
Form A
DoCmd.OpenForm "Audit Entry", acNormal, , Criteria, , , "1"
Form B
Private Sub Form_Load()
Dim iBusUnit As Integer
iBusUnit = Me.Form.OpenArgs
If iBusUnit = 1
Me.RecordSource = "Audit_Data_Med"
Else
Me.RecordSource = "Audit_Data_MH"
End If
End Sub