Compile error for copying field value to other form

Real Wally

Registered User.
Local time
Today, 15:55
Joined
Jan 28, 2003
Messages
107
My main form has several buttons that open a next form. The main form has an PubID field (autonumber), the form that opens also has a PublicationID field in a combobox or a field. What I'd like to happen is that upon opening the 'follower form' the PublicationID field values gets copied to the combobox. B.t.w. over time there will be multiple records for the same PublicationID in the 'follower form'.

I've tried to accomplish this with code as below. This doesn't work and gives compile errors; Invalid use of property.

Please advice.

Thanks,

Wally

Under the button on the main form:

Private Sub Command107_Click()
On Error GoTo Err_Command107_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmOfficialActions"

DoCmd.OpenForm stDocName,,,,,,Me!
PublicationID

Exit_Command107_Click:
Exit Sub

Err_Command107_Click:
MsgBox Err.Description
Resume Exit_Command107_Click

End Sub
On 'on open' event of follower form:

If Not IsNull (Me.OpenArgs) Then
PublicationID.setFocus
PublicationID = OpenArgs
Call PublicationID_AfterUpdate
End If
 

Users who are viewing this thread

Back
Top Bottom