Call form to create new record using details from current form

Lanser

Registered User.
Local time
Today, 19:03
Joined
Apr 5, 2010
Messages
60
how can I open a new form linked to a different table for data entry by entering a number into a control DispoNumber and using that number inside the new record?
I can get the form to open using OnUpdate but not sure how to transfer the number
 
The following code uses the click event of a command button on the first form but can be placed in another event, if desired.

In The calling form
Code:
Private Sub Go2SecondForm_Click()
If Not IsNull(Me.DispoNumber) Then
  DoCmd.OpenForm "SecondForm", , , , , , Me.DispoNumber
 Else
  MsgBox "A Visit ID Must Be Entered First!"
 End If
End Sub
In the called form
Code:
Private Sub Form_Load()

If Not IsNull(Me.OpenArgs) Then
   DoCmd.GoToRecord , , acNewRec
   Me.DispoNumber = Me.OpenArgs
 End If

End Sub

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom