Simple Question.......?

bluenose76

Registered User.
Local time
Today, 04:16
Joined
Nov 28, 2004
Messages
127
Is it possible to have a sort criteria set on a field that is populated in a table by a lookup?

The reason i am asking is that although i can get a query to show the entire contents of the table, when i try to have a criteria eg:

[please enter registration]

or just in case it is spelt wrong:

Like "*" & [please enter registration] & "*"

This will give a blank return? what am i doing wrong?

Please advise.

Regards
Bev
 
If the string in a Like is not matched in the field search nothing will be returned, ie if your registrations start Hthen numerics and N then numerics are entered no match, the best way to tackle this is to drive the query from a form which has a drop down list populated from the table.

Brian
 
Brian,

Thank you for your reply, I have tried this with a Like criteria and a normal sort and bot are qithout sucess.

I am using a value that is exactly as it is in the table, i have even copied the criteria and pasted it in tothe query when requested to see if i was getting it wrong and still ti does not work.

My problem is that for what i am tryign to acheive, the only thing that is common throughout is the vehicle registration and because it appears in several tables, i populate this using a lookup field, but now i am tryign to query basing upon this lookup field i cannot get it to work?

Can anyone help me with this?

Best regards
Bev
 
I don't really understand your questions , because the use of Sort, and Criteria to filter records, are different, but you can, in a query, do both on fields that are populated in the table using a lookup.
I'm about to go on holiday but if you can attach your database somebody may be able to help.

Brian
 
Are you using table level lookups? These create no end of bother and sometimes simply stop things working properly. It is far better to use a combo box control in a form to populate your tables. You lookup may be showing the registration but your table may be showing a different key field.

If this is a real world application rather than an assignment, bear in mind that vehicle registrations are not good candidates for a primary key. Because registration numbers can be transferred, one vehicle can have more than one registration during its life and the same registration can refer to more than one vehicle.
 

Users who are viewing this thread

Back
Top Bottom