Is it possible

mrtool

Registered User.
Local time
Today, 12:14
Joined
Jul 2, 2009
Messages
45
Hi Everyone..

I have a query and in that query I have a criteria filled in by one field. For example [Fill in the customer]. Now I'm wondering if it's possible to get a drop down list at the side so when access ask you to fill in the customer you can just select it from the list box instead of filling it.

Is it possible, and if it is..How can I do it

I'm using access 2003 by the way
 
Using that method, no. You can create a form with a combo box that displays the choices that way, and have your query get the criteria there:

Forms!FormName.ComboName
 
Hi Everyone..

I have a query and in that query I have a criteria filled in by one field. For example [Fill in the customer]. Now I'm wondering if it's possible to get a drop down list at the side so when access ask you to fill in the customer you can just select it from the list box instead of filling it.

Is it possible, and if it is..How can I do it

I'm using access 2003 by the way

Instead of it asking you to fill it in, just set the criteria in the query to be the combo box and then you do not need to worry about it.

The criteria would be

[Forms]![YourFormNameHere]![YourComboBoxNameHere]

instead of [Fill in Customer]

and you need to make sure that the bound column property is the right column so that the data selected matches what the query is looking for (for example, when putting combo on a form, the usual is for the wizard to set the first column to be the ID and then the second to be the description and the it sets the Bound Column property to 1 and you, wanting the name would probably need to change it to 2 instead).
 
Ok, I filled in my criteria; [Forms]![Clients]![Client Name], but still it's not going through..
Instead of giving my the combo, Access is just telling me Forms]![Clients]![Client Name
Is there something I have to do extra??
 
Name of the field is what y'all mean with the combo name???
 
my guess is that by not specifying a column name, the query thinks that the first column (which is probably the ID number) is what it's suppose to be matching up.

Try using: [Forms]![Clients]![Client Name].Column(1)

You shouldn't be using the client name to find the record however. You should be using the ClientID, in which case the Where clause should be on the that and not the client name.
 
The name of the combo, yes. The bound column would need to be the data needed by the query. You can't refer to the column in a query like that.
 
my guess is that by not specifying a column name, the query thinks that the first column (which is probably the ID number) is what it's suppose to be matching up.

Try using: [Forms]![Clients]![Client Name].Column(1)

You shouldn't be using the client name to find the record however. You should be using the ClientID, in which case the Where clause should be on the that and not the client name.

Anyway, not looking at what should be used. I want to make a drop down of the Client Name. I dont have no ClientID in my table, I have the Client Name and I have that as Primary key in my table, so I want to select it from the drop down.

The name of the form where I want to select the data from is in Project_information and the name of the field is Cname.
 
Can we clarify the names, as earlier you said this:

[Forms]![Clients]![Client Name]

Also, I just noticed earlier you said "Instead of giving my the combo...". The form with the combo must be open when the query runs; the query will not open the form for you. The process is open the form, make selections, then run the query/report.
 
Anyway, not looking at what should be used. I want to make a drop down of the Client Name. I dont have no ClientID in my table, I have the Client Name and I have that as Primary key in my table, so I want to select it from the drop down.

The name of the form where I want to select the data from is in Project_information and the name of the field is Cname.

Using the Client Name as a primary key is just asking for trouble. A primary key should be unique. What happens if you have two clients that have the same name?

I know you have a deadline...but you REALLY should read up on basic database stuff.

as for your query, no wonder it didn't work. The criteria should follow this pattern: [forms]![FormName]![ComboBox] so for you, it would be: [forms]![Project_information]![Cname]
 
Using the Client Name as a primary key is just asking for trouble. A primary key should be unique. What happens if you have two clients that have the same name?

FWIW, I agree with this.
 
Using the Client Name as a primary key is just asking for trouble. A primary key should be unique. What happens if you have two clients that have the same name?

I know you have a deadline...but you REALLY should read up on basic database stuff.

as for your query, no wonder it didn't work. The criteria should follow this pattern: [forms]![FormName]![ComboBox] so for you, it would be: [forms]![Project_information]![Cname]

Yeah, But I Just want to know how to make the combo or drop down by queries and I was planning to go fix the mistakes (incl. the Client name as primary key)that I have later..

But Scooterbug, when I paste it in the criteria it still don't go..It tells me that my expression contains invalid syntax
 
Remember when I used the analogy of the house on the beach and a good foundation? This is where it applies. You would best be served by fixing the Primary key issue NOW, since data is much easier to work with if you relate your tables by keys. Especially since your Client Name is text and a primary key is a number.

A combo box is used when you want to limit what the end user can put in a field. A combo box gets it's data from a row source or query. I'm wondering why you want to filter a combo box to display only one entry.

Can you show us exactly what it says for your row source for the combo box?
 

Users who are viewing this thread

Back
Top Bottom