Thank you Crystal, I incorporated your code into my click event to open the
form
stLinkCriteria = "[CustomerID]=" & Me![CustomerID] & " AND
[CustomerVehicleID] = " &
[Forms]!frmCustomerContactData!frmCustomerVehiclesSub.Form!VehicleMake
but no records show up and there should be 6. When open the form with only
the first criteria
stLinkCriteria = "[CustomerID]=" & Me![CustomerID]
all of the customer's vehicles show, but I want to only open vehicles that =
a specific vehicle make
I did try to open the form with the second criteria
stLinkCriteria = "[CustomerVehicleID] = " &
[Forms]!frmCustomerContactData!frmCustomerVehiclesSub.Form!VehicleMake
but again, no records showed up. I placed a temporary field in the subform
called 'VehicleMake' to see if the value that I expect shows up when the
subform (the one calling the form that I want to meet the specific
criteria), and it does. Not sure where to go from here.
Thanks again for your assistance and any further help will be equally
appreciated.
r/David
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Crystal
Sent: Saturday, September 03, 2011 7:14 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: RE: [MS_AccessPros] How to open a form with multiple conditions
hi David,
remove the delimiters around the 2nd part -- numbers are not delimited
" AND [CustomerVehicleID] = " &
[Forms]!frmCustomerContactData!frmCustomerVehiclesSub.Form!VehicleMakeID
warm regards,
Crystal
* have an awesome day :)
--- On Sat, 9/3/11, David Tolson wrote:
>
> "Data type mismatch in criteria expression"
>
>
>
> From: djsdaddy531
>
>
>
> 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]
Minggu, 04 September 2011
RE: [MS_AccessPros] How to open a form with multiple conditions
__._,_.___
MARKETPLACE
.
__,_._,___
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar