From form to form

jtundra05

New member
Local time
Tomorrow, 04:25
Joined
Jun 19, 2008
Messages
9
I have a "Problem Report" form with an ID#. On this form I have a control button that opens a "Field Problem Report" form.
How do I make the "Field Problem Report" form open and autofill the "Problem Report ID#" field with the Problem Report's ID# so I dont have to enter it manually?
 
You could use the OpenArgs portion of the DoCmd.OpenForm statement to pass the ID# to your new form.
 
To expand on the advice from the 10th planet, something like this, substituting your own exact names.

In your calling form:

Code:
Private Sub YourButtonName_Click()
  DoCmd.OpenForm "FieldProblemReport", , , , , , Me.ID	
End Sub
Then, in the FieldProblemReport form:

Code:
Private Sub Form_Load()
  If Len(Nz(Me.OpenArgs, "")) > 0 Then
    DoCmd.GoToRecord , , acNewRec
    Me.ProblemReportID = Me.OpenArgs
  Else
    DoCmd.GoToRecord , , acNewRec
  End If
End Sub
 
Thanks missinglinq

Code:
Dim Count As Integer
Count = 1

Do Until Count = 100
     Write by Hand "I must be more expansive in my answers"
     Count = Count + 1
Loop
 

Users who are viewing this thread

Back
Top Bottom