combo box columns

E

Erik

I have a form with a combo box on it called [location] I also have a text box
call [area] and i have a command button on the for called [ADDMODEL] The
question i have is the combobox has 16 columns in it which is from a master
table. I wanted to select from that combo box and the location and area. My
master table has duplicat values in the location and different values in teh
area. When i select one of the locations and slect the add model command
button it only adds the first location that is duplicated. I would like to
some how bound both columns so htat the sql query thats runs uses both fields
as criteria not just the location but the location and the area. I how this
makes sense. I will post the sql statment to see if it helps any. Thanks so
much.


*********SELECT tbl_Master_List.id, tbl_Master_List.Location,
tbl_Master_List.area, tbl_Master_List.[Square Footage],
tbl_Master_List.[Thomas (Brass) Model Number], tbl_Master_List.[Thomas
(Brass) Price], tbl_Master_List.[Thomas (Brushed Nickel) Model Number],
tbl_Master_List.[Thomas (Brushed Nickel) Price], tbl_Master_List.[Thomas
(Bronze) Model Number], tbl_Master_List.[Thomas (Bronze) Price],
tbl_Master_List.[Progress (Brass) Model Number], tbl_Master_List.[Progress
(Brass) Price], tbl_Master_List.[Progress (Brushed Nickel) Model Number],
tbl_Master_List.[Progress (Brushed Nickel) Price], tbl_Master_List.[Progress
(Bronze) Model Number], tbl_Master_List.[Progress (Bronze) Price]
FROM tbl_Master_List
WHERE (((tbl_Master_List.[Square
Footage])=[Forms]![frm_Add_House]![House_Square_Footage] Or
(tbl_Master_List.[Square Footage])="null" Or (tbl_Master_List.[Square
Footage]) Is Null))
ORDER BY tbl_Master_List.area, tbl_Master_List.Location;
***********
 
M

Michel Walsh

If you need a complex criteria involving two conditions, you use a
conjunction, AND or OR.


WHERE location= givenLocation AND area = givenArea


Sure, if you use and ANDs and ORs, you may use parentheses to force an order
of evaluation:

WHERE
( location= givenLocation AND area = givenArea )
OR [square footage] IS NULL
OR [square footage] = "null"


The givenLocation and givenArea can be of the syntax:
FORMS!formNameHere!ControlNameHere

as long as the query is use to fill a list (list box, combo box), or as
source for a form.




Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top