I've tried looking through the threads to find something to lead me in the right direction. I have I made some changes to my database based on information I received in this form. Previously I was concatenating cells to get my primary key. Now I'm leaving the cells or fields as they are and making two attributes equal my primary key. I use a button control to open a form. When I setup the button, I was only able to use one stLinkCriteria.
This is some code I found and revised to what I thought was correct.
I removed this portion on purpose because I keep getting this type mismatch error:
Any help would be deeply appreciated.
Code:
Private Sub OpenEquipment_Click()
On Error GoTo Err_OpenEquipment_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmEquipment"
Select Case fraContract
Case 1
strLinkCriteria = "[SiteNameID]=" & "'" & Me![SiteNameID] & "'"
Case 2
strLinkCriteria = "[AreaCode]=" & "'" & Me![AreaCode] & "'"
Case Else
End Select
stLinkCriteria = "[SiteNameID]=" & "'" & Me![SiteNameID] & "'"
stLinkCriteria = stLinkCriteria 'And "[AreaCode]=" & "'" & Me![AreaCode] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenEquipment_Click:
Exit Sub
Err_OpenEquipment_Click:
MsgBox Err.Description
Resume Exit_OpenEquipment_Click
End Sub
This is some code I found and revised to what I thought was correct.
I removed this portion on purpose because I keep getting this type mismatch error:
Code:
'And "[AreaCode]=" & "'" & Me![AreaCode] & "'"
Any help would be deeply appreciated.