Solved

DoCmd.OpenForm not giving expected results

Posted on 2011-09-04
2
344 Views
Last Modified: 2013-11-27
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
Comment
Question by:yddadsjd95
2 Comments
 
LVL 30

Accepted Solution

by:
hnasr earned 400 total points
ID: 36480166
Attach a simple database that demonstrates the issue.
0
 

Author Closing Comment

by:yddadsjd95
ID: 36480288
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now