Sabtu, 03 September 2011

RE: [MS_AccessPros] How to open a form with multiple conditions

 

Oh I'm sorry, the error says:

"Data type mismatch in criteria expression"

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of djsdaddy531
Sent: Saturday, September 03, 2011 6:20 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] How to open a form with multiple conditions

Great Day, I have a form that I want to open a datasheet form with multiple
conditions:

Here is the code behind the click condition that opens the form:

stDocName = "frmRepairOrder-Select4Report2"
stLinkCriteria = "[CustomerID]=" & Me![CustomerID] & " AND
[CustomerVehicleID] = '" &
[Forms]!frmCustomerContactData!frmCustomerVehiclesSub.Form!VehicleMakeID &
"'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

The error message says

Syntix error in string in query expression '[CustomerID]=1 AND
[CustomerVehicleID]= '2715'.

I suspect that it has something to do with the fact the Customer ID and
CustomerVehicleID are numbers and not strings, but I have attempted
different variations of ' " marks, but to no avail.

Thanks in advance for the help.

r/David

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
MARKETPLACE
A bad score is 579. A good idea is checking yours at freecreditscore.com.

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar