Full Version: Search Form
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
Kattracks
I have a form that has multiple cbo controls where the user can search for data. They all work except the one for the Bumper Number. I created them all the same way so im not sure what the problem is. When I look at the form in design view, the control for the bumper number is different from the rest of the controls. I am not sure if this is the problem, but I can seem to get it to look like the others. I have included a screen shot of both the form and the table in design view.

This is what my query looks like for my search form.

SELECT tblVehicles.ID, tblVehicles.GSATagID, tbluGSATag.[GSATag #], tblVehicles.[Bumper #], [tbluDivision POC].[Division POC], tblVehicles.[Division POC_ID], tbluDrivers.Name, [tbluDivision List].Division, tblVehicles.DivisionID, tbluShop.Shop, tblVehicles.ShopID, tbluMake.VehicleMake, tblVehicles.MakeID, tbluYear.VehicleYear, tblVehicles.YearID, [tbluVehicle Description].[Vehicle Description], tblVehicles.[Card (04980)], tblVehicles.VIN, tblVehicles.GVWR, tblVehicles.[GSA EQ CD], tblVehicles.Notes
FROM [tbluVehicle Description] INNER JOIN (tbluShop INNER JOIN ([tbluDivision List] INNER JOIN (tbluYear INNER JOIN (tbluMake INNER JOIN (tbluDrivers INNER JOIN ([tbluDivision POC] INNER JOIN (tbluGSATag INNER JOIN tblVehicles ON tbluGSATag.[GSA TagID] = tblVehicles.GSATagID) ON [tbluDivision POC].DivisionID = tblVehicles.[Division POC_ID]) ON tbluDrivers.[Driver ID] = tblVehicles.[Driver ID]) ON tbluMake.VehicleMakeID = tblVehicles.MakeID) ON tbluYear.VehicleYearID = tblVehicles.YearID) ON [tbluDivision List].DivisionID = tblVehicles.DivisionID) ON tbluShop.ShopID = tblVehicles.ShopID) ON [tbluVehicle Description].VehicleID = tblVehicles.VehicleID
WHERE (((tblVehicles.GSATagID)=[Forms]![frmVehicleSearch]![Combo33])) OR (((tblVehicles.[Bumper #])=[Forms]![frmVehicleSearch]![Bumper #])) OR (((tblVehicles.DivisionID)=[Forms]![frmVehicleSearch]![Combo35])) OR (((tblVehicles.ShopID)=[Forms]![frmVehicleSearch]![Shop])) OR (((tblVehicles.MakeID)=[Forms]![frmVehicleSearch]![Make])) OR (((tblVehicles.YearID)=[Forms]![frmVehicleSearch]![Year])) OR (((tblVehicles.[Division POC_ID])=[Forms]![frmVehicleSearch]![Division POC]));

Any help would be greatly appriciated

Thanks!
Kat

theDBguy
Hi Kat,

What exactly do you mean by "They all work except the one for the Bumper Number?" What is happening or not happening (but supposed to) in your form or query?
Kattracks
When I enter the search criteria in the form it brings up the correct information in all the controls except for the Bumper Number. When I run that it returns a blank form instead of the record associated with the specified bumper number.
theDBguy
Hi,

My guess is that it has something to do with the relationships you used in your query. If there are records in other tables that don't have a matching bumper number, then using an INNER JOIN will also exclude them from the query result. If that's the case, try using an outer JOIN (LEFT or RIGHT).

Just my 2 cents... 2cents.gif
Kattracks
The field for the bumper number is on the main table, so there is no join for it. As far as one of the vehicles not including the bumper number, I went back to ensure that they all had one. I am including a screen shot of the Query in design view, maybe the problem is there.

Kattracks
I can get it to bring up the results when I use an unbound text box and type in the criteria; however it will not work with a combo box. Any suggestions?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.