cavscout
Registered User.
- Local time
- Yesterday, 20:35
- Joined
- Mar 13, 2003
- Messages
- 74
I want the user to click a button on a sub-form (continuous form format) and pass the value of a field (ColorCode) in that record to a new form which opens from the button click and autopopulate the field (ColorCode) on the new form.
First Form is: On button click
stDocName = "frm-EditPaintAllocation"
DoCmd.OpenForm stDocName, , , , , , Me.ColorCode.Value
Second Form is:
Private Sub Form_Open(Cancel As integer)
DoCmd.GoToRecord acDataForm, "frm-EditPaintAllocation", acNewRec
If Not IsNull(Me.OpenArgs) Then Me.ColorCode = Me.OpenArgs
End Sub
The code above appears to not recognize the OpenArgs that is being passed from the first form as I tried this with a Select Case method and the last Case was returned.
I'm not seeing why this isn't working. If anyone can point out the issue please?
Thanks!
First Form is: On button click
stDocName = "frm-EditPaintAllocation"
DoCmd.OpenForm stDocName, , , , , , Me.ColorCode.Value
Second Form is:
Private Sub Form_Open(Cancel As integer)
DoCmd.GoToRecord acDataForm, "frm-EditPaintAllocation", acNewRec
If Not IsNull(Me.OpenArgs) Then Me.ColorCode = Me.OpenArgs
End Sub
The code above appears to not recognize the OpenArgs that is being passed from the first form as I tried this with a Select Case method and the last Case was returned.
I'm not seeing why this isn't working. If anyone can point out the issue please?
Thanks!