Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 394
  • Last Modified:

DoCmd.OpenForm not giving expected results

Great Day! I am trying to open a form with the following criteria

    stLinkCriteria = "[CustomerID]=" & Me![CustomerID] & " AND [CustomerVehicleID] = " & [Forms]!frmCustomerContactData!frmCustomerVehiclesSub.Form!VehicleMake

but no records show up and there should be 6. When I 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 in advance for your help.

r/David

Thanks again for your assistance and any further help will be equally appreciated.

r/David

stLinkCriteria = "[CustomerID]=" & Me![CustomerID] & " AND [CustomerVehicleID] = " & [Forms]!frmCustomerContactData!frmCustomerVehiclesSub.Form!VehicleMake

Open in new window

0
yddadsjd95
Asked:
yddadsjd95
1 Solution
 
hnasrCommented:
Attach a simple database that demonstrates the issue.
0
 
yddadsjd95Author Commented:
Thank you hnasr, while I was stripping the unnecessary objects from the database, I discovered that I needed to be looking at VehicleMakeID and not CustomerVehicleID. One of those rare occasions that someone pointed me in the right direction and I figured it out. Thanks .
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now