Selecting options in a query

virgosam20

Registered User.
Local time
Today, 23:16
Joined
Jul 7, 2007
Messages
49
Sure its simple to do, I just don't know! lol.

I want to create a query, where the user can choose from 3 products to choose from (from the same table, under the same field name) that they can search for to find which customers r buying it.

Ideas....?
 
create a combo box on your form. in the query criteria for your productID <-assuming this is your pk
put
[forms]![formname].[comboboxname]
 
The Product field is within another form as this is where it is more suited. Therefore, should i put the pk of the table it is in (CustomerID)?
And where would i put:
[forms]![formname].[comboboxname] ? In the query or the form?
 
The Product field is within another form as this is where it is more suited. Therefore, should i put the pk of the table it is in (CustomerID)?
And where would i put:
[forms]![formname].[comboboxname] ? In the query or the form?

how is your database structured? it seems to me like you should have a product table and a customer table. Hope this is how it goes. If not you should read up on normalization.
 
No, I don't have a seperate table for product. I know I probably should, but the database is far too finished to be messing around with it. adding another table would cause alot of problems.
When the customer puts in the product in the current form, they can select from 3 different ones. These are the three that I would like them to be able to search frm in the query.
Basically I want to filter all the records using one field. Do I even have to use a query?
 
No, I don't have a seperate table for product. I know I probably should, but the database is far too finished to be messing around with it. adding another table would cause alot of problems.
When the customer puts in the product in the current form, they can select from 3 different ones. These are the three that I would like them to be able to search frm in the query.
Basically I want to filter all the records using one field. Do I even have to use a query?

I would advise you to rethink the not adding a new table for your products... what if there is a 4th product added at somepoint? its going to be a pain to add that.Also querying is much easier when you have unique id's to use instead of names
 
Please follow the advice of rainman89 It will save you many headaches in the future, i went trough this and it really does. But i guess sometimes you have to experience it to really realize.

If u follow it or not, a solution for this is to make a Combo box with the 3 options you say and on the After update event

Sub cmbProducts_AfterUpdate

Me.Filter = "fldProducts = " & cmbProducts
Me.FilterOn = True

End Sub
 

Users who are viewing this thread

Back
Top Bottom