Query from form help.

  • Thread starter Thread starter jokeascool
  • Start date Start date
J

jokeascool

Hello All,


I have a query that pulls a concatenated parameter from a form. The
query pulls several single parameters from the form as well. Thus the
where part of the query looks like this:


WHERE (((Community_tbl.Community_Cod­e)=forms!frmschedulea!commID) And

((Trade_Partner_Products_Tbl.V­endor_Id)=forms!frmschedulea!V­enID)
And
((Trade_Partner_Products_Tbl.P­hase)=forms!frmschedulea!phase­) And
((Take_Offs_Tbl.House_Code)=fo­rms!frmschedulea!text10) And
((Take_Offs_Tbl.Product)<>"tyv­ek"));


My question is this, how should i concatenate the parameter in on the
form. Right now when the for each next loop is done the parameter
looks like this:


"vb1"or"vb2"or"vb3"


Will this be correct or should it include the where statement or should

it look totally differnt??


Thanks


Joe
 
What for-next loop?

Jeff Boyce
<Access MVP>

Hello All,


I have a query that pulls a concatenated parameter from a form. The
query pulls several single parameters from the form as well. Thus the
where part of the query looks like this:


WHERE (((Community_tbl.Community_Cod­e)=forms!frmschedulea!commID) And

((Trade_Partner_Products_Tbl.V­endor_Id)=forms!frmschedulea!V­enID)
And
((Trade_Partner_Products_Tbl.P­hase)=forms!frmschedulea!phase­) And
((Take_Offs_Tbl.House_Code)=fo­rms!frmschedulea!text10) And
((Take_Offs_Tbl.Product)<>"tyv­ek"));


My question is this, how should i concatenate the parameter in on the
form. Right now when the for each next loop is done the parameter
looks like this:


"vb1"or"vb2"or"vb3"


Will this be correct or should it include the where statement or should

it look totally differnt??


Thanks


Joe
 
Sorry Jeff I did not post the for next loop because it is working fine.
I just posted the query and the results of the loop. I was just
wondering is the syntax of the results of the loop are correct or if
they should be changed. The
(Take_Offs_Tbl.House_Code)=fo­­rms!frmschedulea!text10) is the line
that pulls the parameter from the list box.

I hope that I have not confused anyone. If so I will try to clear it
up.

Thanks for your help!

Joe
 
Joe

I'm having trouble guessing whether what your query does is what your loop
needs because I don't understand what you are trying to do.

A little more context, please? (you've described "how", but not "why" ...
as in what business need are you trying to satisfy)

Jeff Boyce
<Access MVP>

Sorry Jeff I did not post the for next loop because it is working fine.
I just posted the query and the results of the loop. I was just
wondering is the syntax of the results of the loop are correct or if
they should be changed. The
(Take_Offs_Tbl.House_Code)=fo­­rms!frmschedulea!text10) is the line
that pulls the parameter from the list box.

I hope that I have not confused anyone. If so I will try to clear it
up.

Thanks for your help!

Joe
 
Sorry Bout that Jeff.

I have a query that draws information from several tables. I then use
this query as a basis for a report. The qeury relies on user input for
4 feilds.

Thus I developed a form that allows the user to input the correct
information.

On the form there are 4 fields.

Field 1 allows the user to pick the community he wishes to work
with(single input only)

Field 2 allows the user to pick a vendor(single input only)

Field 3 allows the user to pick the phase of construction they wish to
look at. Many vendors deal with more than one phase however they may
only run the report with only one selection(single input only)

Field 3 allows the user to pick the house types they would like to see
on the contract(this could be one house or perhaps 10 houses) Thus
this is the need for the for...each...next loop to concatenate the
parameter for the query.

I sure hope that was enough information!

Thanks for your help!

Joe
 
Are you using a listbox with Multi-select enabled for the house types?

Have you considered using the In('a','b','c') expression rather than "'a' or
'b' or ..."?

Good luck

Jeff Boyce
<Access MVP>
 
Back
Top