Hi,
I'm having a bit of an issue (confusion) about passing variables from one from to another. I'm worked out the code but something isn't quite right.
The user will select the Issues form, fill out the information requested and click an activity that is associated with the issue. I am grabbing the PK from the issue form (that field is hidden) and passing it to the FK field in the activity form (FK also hidden). That works fine. When the user clicks the appropriate activity button, the code below is run:
Option Compare Database
Private Sub CanvassingCommand_Click()
DoCmd.OpenForm "frmCanvassing Activities", acNormal, , , , acWindowNormal, [ProgramID]
End Sub
When the form loads, the On Load event runs the code below:
Option Compare Database
Private Sub Form_Load()
Dim i As Integer
i = CInt(Me.OpenArgs)
Me.ProgramID.Value = i
End Sub
This works just fine. The problem is when they return to the Issues form, fill out a new issue and then click the activity, let's say the same one for a new issue, the form returns the last issue and not a new data entry. So, how would I reset the variable to get the new PK, etc. (Providing I'm on the right track)
Thanks,