Parameter not getting passed from combo box to a query

drspanda@gmail.com

New member
Local time
Today, 19:34
Joined
Jan 30, 2015
Messages
9
Dear All,

I am new to access. I have created a form in which I used a combo to show Main Area Name. this value is passed into a query to show only area under main area only. Created another combo to activate the query to show the area.

Somehow it is not working...I am unable to find mistake.

please help me.
 

Attachments

Your first mistake is keeping default names, Combo10 or Combo12 is hardly a comprehensive control name.

Second, I cant select anything in the new combobox anyways, but your query simply doenst have any reference to [Forms]![FrmLocal]![Combo12]
If it isnt referencing it, how can you expect it to be used?
 
Because the first column, (the hidden one) of the combobox is a number (ID), and not the name of the area.
 
Aha, I thought the question was about the second combo not working... now I see the first (also) has/had a problem
 
Because the first column, (the hidden one) of the combobox is a number (ID), and not the name of the area.

If I open the query and give criterion as "ADPH" the query is giving output...I have tested the query.

Even though I have given name of the area not ID, it is not getting passed into query.

My question/doubt may be very basic in nature...please help me and guide me to accomplish this task.
 
The matter at hand is exactly that, while the combo10 is selecting ADPH...
It has 2 columns, ID and Area name.
The "Bound column" is the first column, the ID... So while it displays ADPH for human eyes, the computer actually stores the bound column, the ID, in this case 1.

So in your query you are comparing ADPH to 1 which obviously wont work.
So you need to put your search on the ID not on the name field.
 
The matter at hand is exactly that, while the combo10 is selecting ADPH...
It has 2 columns, ID and Area name.
The "Bound column" is the first column, the ID... So while it displays ADPH for human eyes, the computer actually stores the bound column, the ID, in this case 1.

So in your query you are comparing ADPH to 1 which obviously wont work.
So you need to put your search on the ID not on the name field.

Yes, I have made change in query to look for ID....It worked.

I am thankful to all of you.
 

Users who are viewing this thread

Back
Top Bottom