HELP with SEARCH FORMS

john151

Registered User.
Local time
Tomorrow, 06:38
Joined
May 26, 2006
Messages
12
Hi
At first I have to say, that I am a beginner, and that I am not familiar with VBA… though I have got a question.

I am working on a database with many addresses of Companies and Contacts. Now I want to install a search, so that the user can look for any information by using parameters in a form. How do you do that?
I found a excellent example for my thoughts but I do not have any idea how to realize this>
http://jfconsult.home.comcast.net/tips/
I am especially interested in the second search which shows all the results in a subsheet *or Listbox?* in which you can click the record an view it in a new window. This would be exactly what I want.

I would be so thankful for any hint and help!
Thank you!

John

PS please ask me if you have any questions to the thread;)
 
there are couple of search forms based databases in the sample database sub-forumn. u can take a look at the code and see the comments to gain a rough knowledge. another tip to start off, use the Help file :)

some examples on top of my head
db as codedb() --defines ur database
qdf as querydef --this is used to create a query based on ur search parameters
sqlstring as string -this string variable stores ur query as a sql statement
qdf.sql = sqlstring --this links the created sqlstring to the querydef to "save" your query

a simple statement to capture data from a control
quot = "'"
sqlstring = sqlstring & "WHERE/AND fieldName = " & quot & me.controlname & quot

the above adds the statement "WHERE fieldname = user input value" into your sql statement.

Cheers
 
listen bro, i think what you need is very simple. i think you don't need VBA at all.

do this:
start a form in design view, make it unbouned, meaning, don't attach a table or query to it. then put on it the few parameter text or combo boxes you are interested in. save it, keep it open, go to the form view and enter information. now minimize it. start a query in design view, and the criteria box right click and select build. go form, loaded forms and you will see the open form there, and select the field that has the parameter and see if it works.

good luck,

sam
 
cool!

thanks!

I think it is a good start. It already kind of worked.

but If I have a question again, I will come back to you!

thanks again!

john:)
 

Users who are viewing this thread

Back
Top Bottom