Steve@trop
Registered User.
- Local time
- Yesterday, 22:15
- Joined
- May 10, 2013
- Messages
- 148
I'm trying to open a form to a specific record using the criteria in the docmd.openform command. I know the criteria are correct individually because they both work when I use them one at a time but when I try to put them together I get errors. Here is how I have it together in it's latest form:
When I run it I get a "type mismatch" error. If I pull out one or the other criteria (before or after the "and") it works fine but I need both criteria to open the correct record.
I know it's probably something really simple like a different type of quote or something. I know it's really close because the criteria work OK by themselves it's just when I try to put them together that it fails.
As usual any type of help you can give on this is greatly appreciated!
Code:
DoCmd.OpenForm "CTableSearchF", , , "[ctable].[lastname] = '" & LastNamestr & "'" And "[ctable].[phonenumber] = '" & PhoneNumberstr & "'"
I know it's probably something really simple like a different type of quote or something. I know it's really close because the criteria work OK by themselves it's just when I try to put them together that it fails.
As usual any type of help you can give on this is greatly appreciated!