stLinkCriteria

Treason

#@$%#!
Local time
Today, 00:06
Joined
Mar 12, 2002
Messages
340
I used the Command Button Wizard to create a button to open a new form. I am trying to edit the OnClick property of that button so I can better set the form Link Criteria. Using The wizard it allows me to link [Stud_ID] to [Stud_ID].. But I wish to link more than one set together.. I wish to link [Stud_ID] to [Stud_ID] and [Period] to [Period]. So First it finds the Students ID# then pulls the corresponding Period for update. I have tried SO many things and I keep getting Type Mismatch errors...

I'll post one of the 50 button events i have attempted...


Code:
    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "FrmComment"
    stLinkCriteria = "[Student_ID]=" & "'" & Me![Stud_ID] & "'" AND "[Period]=" & "'" & Me![PD] & "'"
    
    DoCmd.OpenForm stDocName, , , stLinkCriteria


Save me from bashing my head through the keyboard :mad:
 
Try this...

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "FrmComment"
stLinkCriteria = "[Student_ID]= " & Me![Stud_ID] & "AND [Period]= " & Me![PD]

DoCmd.OpenForm stDocName, , , stLinkCriteria

HTH
 

Users who are viewing this thread

Back
Top Bottom