View Full Version : Passing Parameters


sakthivels
06-15-2009, 11:45 PM
Hello Everyone,

I have a Table tblCustomers, where I store the details about the Customers like, CustomerID, Name, Address, Contact Number (Office / Residence / Mobile 1 / Mobile 2).

I have designed a form where the user can give any of the detail like CustomerID or Name or Contact Number. and search for the Customer Record.

I also have a general query where I don't give any parameters.

I would like to know how I can utililize the query for passing parameters.

Kindly advise me on this.

Regards,
Sakthivel.

JohnLee
06-16-2009, 05:03 AM
Hi,

Create a query based on your table and base your form on your query. This way you can specify your variable parameters within the query and when ever your end user opens up the form, they will be prompted to specifiy their parameters according to the variables you have set in your query.

FAB

John

sakthivels
06-16-2009, 06:25 AM
Mr. JohnLee

I am sorry I don't understand you. I already have a form where I have 4 unbound textboxes One each for ClientID, ResPhone, OffPhone, Mobile1, Mobile2 and a command button.

So when the user enters any of the four values and clicks the search button. I want the results to be displayed.

I also have a query which pulls the values from the table. This query doesn't have any parrameters passed to it. Its is just a simple Select Query.

Can you please elaborate more on about passing the values in the textbox in the form to the query, so that I can put the results in a list box or a form.

Regards,
Sakthivel

namliam
06-16-2009, 06:41 AM
Try a search on the forum for "search form" you should find a sample or two in the "Samples" part of the forum

Good hunting!

JohnLee
06-16-2009, 07:49 AM
Hi,

From your initial post you indicate that you have a table and you also have a form and a query, what you do not say is weather or not the form is based on the table or based on the query, therefore I have assumed that the form is based on the table.

I also assumed that the query you mentioned is based on the table as well. So if you base your form on your query [which I assume is based on your table] you will be able to pass parameters directly to the query, but first you must set up your query so that it will take the parameters you want to pass to it. Once you have done that your form will display the data according to the parameters passed to it.

FAB

John

sakthivels
06-16-2009, 08:54 PM
Mr. JohnLee

I am sorry for not giving a clear picture of my problem. I attach the Database so that you can go through and help me.

Regards,
Sakthivel

JohnLee
06-17-2009, 12:17 AM
Hi,

Unfortunately I can not open your test_Client DB, as it's a version higher than what I am currently using.

FAB

John

sakthivels
06-17-2009, 09:25 PM
Hi,

Unfortunately I can not open your test_Client DB, as it's a version higher than what I am currently using.

FAB

John

Sorry Mr.JohnLee,

I attach the 97 and 2000 version of the same database.

Regards,
Sakthivel

namliam
06-17-2009, 11:40 PM
Try a search on the forum for "search form" you should find a sample or two in the "Samples" part of the forum

Good hunting!

Have you even tried looking for this?

sakthivels
06-18-2009, 12:59 AM
Have you even tried looking for this?

Thanks Mailman,

I'll search for as you had said.

JANR
06-18-2009, 01:35 AM
Allen Brown has search form which I think is something to explore.

http://allenbrowne.com/ser-62.html

I used his template to get you started, but you have to finish it yourself. ;)

See the code behind your form and expand on it to include the rest of your searchboxes using my template. A new Form called frmSearchRes is added.

JR

sakthivels
06-18-2009, 02:53 AM
Thanks Janr,

Its working. Now that I have an idea. I'll try and reuse it. Thanks a lot for helping.

I also thank all the forum members for helping me in this thread.

Regards,
Sakthivel