Hello,
I created a table-based form that contains a button that opens other form. I want that the new form keep the user id and the visit number (both text boxes with numbers)
I typed the following code, but I get "Type Mismatch":
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "VISIT"
stLinkCriteria = "[User_Id]=" & Me![User_Id] And "[visit_number] =" & Me![visit_number]
DoCmd.OpenForm stDocName, , , stLinkCriteria
I've also tried this but Access asks me the visit number
stLinkCriteria = "([User_Id]=" & Me![User_Id] & ") And ([visit_number] =" & Me![visit_number] & ")"
Does anybody know can I solve this?
Thank you in advance for your help
Irene
I created a table-based form that contains a button that opens other form. I want that the new form keep the user id and the visit number (both text boxes with numbers)
I typed the following code, but I get "Type Mismatch":
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "VISIT"
stLinkCriteria = "[User_Id]=" & Me![User_Id] And "[visit_number] =" & Me![visit_number]
DoCmd.OpenForm stDocName, , , stLinkCriteria
I've also tried this but Access asks me the visit number
stLinkCriteria = "([User_Id]=" & Me![User_Id] & ") And ([visit_number] =" & Me![visit_number] & ")"
Does anybody know can I solve this?
Thank you in advance for your help
Irene