Open Form from SubForm Using Multiple Criteria

OCC_SF_Access

New member
Local time
Yesterday, 21:05
Joined
Sep 17, 2008
Messages
7
Hello All,

My inquiry is regarding passing multiple parameters in order to open a specific record within Form_B, once a DoubleClick Event has occurred within a specific field of a record within Form_A. Below is some information about my setup:

SubForm Name: Form_A
Form_A Field Names: Field_A and Field_B
Form To Be Opened: Form_B
Form_B Field Names: Field_A and Field_B

Goal: When a user double clicks within Field_A of Form_A, Form_B should be opened for the record where Field_A and Field_B are the same as those of Form_A

Please let me know if I can clarify anything further.

Thanks!
 
Below is the code that I am currently using within the DoubleClick Event of Field_A within Form_A:

Private Sub Field_A_DblClick(Cancel As Integer)

Dim setLinkCriteria_1 As String
Dim setLinkCriteria_2 As String
setLinkCriteria_1 = Me.Field_A
setLinkCriteria_2 = Me.Field_B
DoCmd.OpenForm "Form_B", acNormal, , setLinkCriteria_1 And setLinkCriteria_2

End Sub
 
Your criteria is off. It would have to be:


DoCmd.OpenForm "Form_B", acNormal, , "[Field_A]='" & Me.Field_A & "' And [Field_B]='" & Me.Field_B & "'"
 

Users who are viewing this thread

Back
Top Bottom