Solved

DoCmd.OpenForm not giving expected results

Posted on 2011-09-04
2
331 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
Comment Utility
Attach a simple database that demonstrates the issue.
0
 

Author Closing Comment

by:yddadsjd95
Comment Utility
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 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

10 Experts available now in Live!

Get 1:1 Help Now