Open another Database Form on specific record

jamescullis

Registered User.
Local time
Tomorrow, 06:17
Joined
Jun 2, 2014
Messages
38
hi all,

I'm wanting to open a record in another database, below is the code that opens the form to the correct record in the DB I want to open.

can anyone shed light on code required to do this please?

Code:
Private Sub btnDetail_Click()
    DoCmd.OpenForm "fJob", , , , , , Me.Name
    Forms![fjob]![txtJobNumber] = Forms![fJobAlphabetic]![fJobAlphabeticSub].Form![JobNumber]
End Sub

thx
 
The code you want is something like

DoCmd.OpenForm "fjob", , , "myName='" & Me.myName & "'"

You will need to change the bits in red to suit. Note that Name is a reserved word and it's use can have unexpected consequences - for example Me.Name is the name of the form the code is written, not the value in a field on that form.
 
thanks Cj, I'll try that.
 

Users who are viewing this thread

Back
Top Bottom