I have a main form with a reference number(DocRef) NOT the record ID
I set a command button to open a new form to add to a table linked to the main table but I can't get the Reference to come across I just get a #Name? error and unless I manually enter the DocRef it just creates a blank entry I have tried using a Where statement instead of OpenArgs but that just leaves the reference box blank
On Documents Form
and New Version Form
I set a command button to open a new form to add to a table linked to the main table but I can't get the Reference to come across I just get a #Name? error and unless I manually enter the DocRef it just creates a blank entry I have tried using a Where statement instead of OpenArgs but that just leaves the reference box blank
On Documents Form
Code:
Private Sub New_Version_Click()
DoCmd.OpenForm "NewVerForm", DataMode:=acFormAdd, WindowMode:=acDialog, OpenArgs:=Me.DocRef
End Sub
and New Version Form
Code:
Private Sub Form_Open(Cancel As Integer)
Me.DocRef.DefaultValue = Me.OpenArgs
End Sub