Query using form textbox.

  • Thread starter Thread starter Moon Walker
  • Start date Start date
M

Moon Walker

Dears,

Please help me with this.

I have a table containing about 10000 customers, and each customer has his
own CUST_ID.

Now I want to make a form containing a command bottom to run a query,
And a textbox to paste the wanted customers which copied from excel file,
now when I paste the customers number to the textbox it appears vertically
one after one, And till now it's ok, but when I run the query only the first
pasted customer returns by the query.

Is there any solution to make the all pasted CUST_IDs returned by the query?


Best Regards……..

Shaker Rayya
 
Dears,

Please help me with this.

I have a table containing about 10000 customers, and each customer has his
own CUST_ID.

Now I want to make a form containing a command bottom to run a query,
And a textbox to paste the wanted customers which copied from excel file,
now when I paste the customers number to the textbox it appears vertically
one after one, And till now it's ok, but when I run the query only the first
pasted customer returns by the query.

Is there any solution to make the all pasted CUST_IDs returned by the query?

I'd suggest importing or linking to the list of cust_ids, and *joining* the
table of desired ID's to the customer table.
 
Dear,
thanks for your reply, but I still want to use the textbox control as a
parameter for the query and I want to make this parameter to accept multi
values (Multi Cust_IDs)
 
Dear,
thanks for your reply, but I still want to use the textbox control as a
parameter for the query and I want to make this parameter to accept multi
values (Multi Cust_IDs)

Then you will need to construct the SQL for your query in VBA code, using a
syntax like

.... WHERE Cust_ID IN (" & Me!txtCustIDCriteria & ")"
 
Ok, but it seem obscure to me,

would you help writing a sample of the suggested VBA code, and where this
code must be written.

Thanks in advance,,,,,,,,,
 
Ok, but it seem obscure to me,

would you help writing a sample of the suggested VBA code, and where this
code must be written.

Well, not without knowing anything about the structure of your table or how
you intend to use the code, no. More info please?
 
well,
table name: All_Data
table fields: Cust_ID, name, address, cell_phone
form name: Form1
Forme controls: textbox (List) and a command button (Command3)to run the
query1
 
Back
Top