capturing combo-box value for a query

  • Thread starter Shivalee Gupta via AccessMonster.com
  • Start date
S

Shivalee Gupta via AccessMonster.com

i have a form-form1. inside i have a combobox-combo0. whenever user selects a value from within the combobox, it is displayed in the textbox also there on the form-text2.now i have a query in access itself based on 2 tables in my db.

select a.col1
from a,b
where a.name=b.name
and b.col2="value selected from the combobox".
this capturing of value from combo box for my query ,i am unable to do. please help.
 
J

Jeff Boyce

Shivalee

In your query, in design mode, add a reference to the form's control in the
Criterion for the field. It will look something like:

Forms!YourForm!cboYourComboBox

--
Good luck

Jeff Boyce
<Access MVP>

Shivalee Gupta via AccessMonster.com said:
i have a form-form1. inside i have a combobox-combo0. whenever user
selects a value from within the combobox, it is displayed in the textbox
also there on the form-text2.now i have a query in access itself based on 2
tables in my db.
 
M

Marshall Barton

Shivalee said:
i have a form-form1. inside i have a combobox-combo0. whenever user selects a value from within the combobox, it is displayed in the textbox also there on the form-text2.now i have a query in access itself based on 2 tables in my db.

select a.col1
from a,b
where a.name=b.name
and b.col2="value selected from the combobox".
this capturing of value from combo box for my query ,i am unable to do. please help.


You can refer to the value in a control using this kind of
reference:
. . .
And b.col2=Forms!form1.text2
 

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