Open new form with current forms record?

kawi6rr

Registered User.
Local time
Today, 08:33
Joined
Jun 29, 2010
Messages
28
I have a button on a form that opens a completely new form. What I want it to do is open that new form with the current forms record source ID.

I know this works from from to subform.

Forms!UTI_Main.patID = Me.patID

I hope this makes sense, thanks.
 
Problem solved!

Private Sub btn_OpenUTI_StageTwo_Click()
On Error GoTo Err_btn_OpenUTI_StageTwo_Click
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "UTI_Main"
stLinkCriteria = "[patID]=" & Me.patID
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_btn_OpenUTI_StageTwo_Click:
Exit Sub
Err_btn_OpenUTI_StageTwo_Click:
MsgBox Err.Description
Resume Exit_btn_OpenUTI_StageTwo_Click

End Sub
 

Users who are viewing this thread

Back
Top Bottom