Select Query

Schillers

Registered User.
Local time
Today, 21:14
Joined
Mar 17, 2012
Messages
23
SELECT TblFacilityAssetType.[Facility Code]
FROM TblFacilityAssetType
WHERE (((TblFacilityAssetType.[Facility Description]=[Forms]![Booking Facilities].[Facility_Code])));

Doesn't work? I can't work out why? Any ideas?
 
I wonder what "doesn't work" means exactly. ;)

Offhand, you appear to be comparing a description field to a code field.
 
Haha Basically, the process involved is that the the user would choose a description of a facility and the query would match the input (Now more appropriately named as 'Facility_Description') to the facility code in the same row? If that makes sense.

I have changed the query due to the new names to:

SELECT TblFacilityAssetType.[Facility Code]
FROM TblFacilityAssetType
WHERE (((TblFacilityAssetType.[Facility Description]=[Forms]![Booking Facilities].[Facility_Description])));

If I run the form and select a value then run the query. The value I get in the datasheet from the query is '(new)'?
 
Can you post the db here?
 
Not clear on what I'm looking for, as I don't see that SQL anywhere offhand. That said, the bound column of that combo is the code field, so your query should probably be using that field in the criteria.
 
Okay, everything in the database now works. apart from one final task. I need to somehow create a query that that reads a caravan number from tblcaravanbooking and shows all the booking references associated with it. I just need a format to work with?
 

Users who are viewing this thread

Back
Top Bottom