Sorry to such a pain. I would attached the whole db but it is very large with many objects.
I am trying to pass the planid from a subform to a pop-up form. From the pop-up form I want to add a new record.
The pop-form has a query behind it and the field name in the query and table where the row to be added is a field name of "cont#".
I am getting the attached error. It is flagging the Me.Cont# line. The field is Cont# on a query attached to the form. I change the value on the load of the pop-up to me.cont# for the pass field.
Below is the from form code - see the Private Sub AddNewWorkItem that is where I am trying to pass the planid to the pop-up form:
Code:
Option Compare Database
Option Explicit
Public StrPlanID As String
Private Sub AddNewWorkItem_Click()
Dim Response As Long
Response = MsgBox("Please confirm the adding of a record.", vbYesNo + vbQuestion, "... Adding a new Work Activity Record ...")
If Response = vbYes Then
' StrPlanID = Me.PlanNumberMatched
StrPlanID = "123456"
DoCmd.OpenForm "frmPopUpPlanDocWorkTracking", acNormal, , , acFormAdd, , StrPlanID
Else
StrPlanID = "123"
End If
End Sub
Private Sub EditWorkItem_Click()
' pop-up window - Aug.2012
DoCmd.OpenForm "frmPopUpPlanDocWorkTracking", , , "[IDMainTable]=" & Me!IDMainTable, windowmode:=acDialog
End Sub
Below is the to form code that is to write the new row:
Code:
Private Sub Form_Load()
If Nz(Me.OpenArgs, "") <> "" Then
Me.cont# = Me.OpenArgs
' DoCmd.GoToRecord , , acNewRec
End If
' DoCmd.MoveSize left, right, width, height
DoCmd.MoveSize 2400, 1550, 10522, 4444
End Sub
Thanks for keeping with me on this problem.
Russ