View Full Version : searching


a.mlw.walker
06-25-2007, 07:58 AM
Hi, I have two questions which i dont think are two far apart, hence same thread.

First is, how do i make a search text box, that when i click a button searches for what is in that text box, rather than bringing up the find box. It is alright but it always compares it to what was last tabbed, or is the selected tab, and i want it always to compare to another textbox called company name.

secondly. I am often entering entries to the database with the same details. but a different name, how can i have it so that i enter say 4 or 5 names which starts 4 or 5 new records, but then places the rest of the details across all the new records.

THANKS
aLEX

Dennisk
06-25-2007, 10:47 PM
Searching.
In the Button Code you can apply a filter - see docmd.applyfilter or you can create a query that uses the text box as criteria and set that as the forms recordsource.

You will have to create your own pseudo clipboard to store data from a record. I use a UDT (User defined type) but you can use a variant array or a class. All you would then need is a button to store the data and one to retreive it.

neileg
06-26-2007, 12:18 AM
secondly. I am often entering entries to the database with the same details. but a different name, how can i have it so that i enter say 4 or 5 names which starts 4 or 5 new records, but then places the rest of the details across all the new records. If you are repeating the same data in several records, you need a redesign. Say you have several contacts at one company, then you need a table for contacts and a table for companies.