Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can not get Access 2016 queries to accept form value input or TempVars! input 2

Status
Not open for further replies.

TheresAlwaysAWay

Programmer
Mar 15, 2016
135
US
I've been working in Access 2007 forever and have a myriad of places where a form input is used as a query parameter. In the Criteria line I simply put [Forms]![FormName]![FieldName] and that's all that's ever been necessary. That has also been true of a temporary variable. I only had to put [TempVars]![VariableName] in the Criteria line and everything worked as expected.

I've switched to Access 2016 and I can't get it to accept those Criteria. I get an error message that says, "The Microsoft Access Database Engine does not recognize " as a valid field."

I've done this so often in the past that I just can't understand what the issue could be. I'm hoping one of you wizards can point me in the right direction.

As always, thanks in advance for any replies.
 
Well, two multi-select list boxes: one for VehicleTypes and one for States

>show all MC in CA, GA, and FL
[tt]WHERE [VehType] IN ('MC') AND [State] IN ('CA', 'GA', 'FL')[/tt]

>all RV in NY, NM, AZ, and KY
[tt]WHERE [VehType] IN ('RV') AND [State] IN ('NY', 'NM', 'AZ', 'KY')[/tt]

>all MC and RV in UT, TN, WI, and MI
[tt]WHERE [VehType] IN ('MC', 'RV') AND [State] IN ('UT', 'TN', 'WI', 'MI')[/tt] :)

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
I hate to leave you guys hanging. I didn't follow through with the State thing yet and it depends on time and a couple of other things. If I do I'll let you know. Meantime I'm just gonna leave the boss with vehicle selection for now.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top