Search Query Populate Form

B

Big Tom Tuttle

Maybe someone can help here? I have read multiple postings out there on how
to search using a combo box or text box unbound. I have 2 forms, 1 query,
and 1 table named respectively:

form(s): "frmMain" & "frmCrit"
table(s): table 1
query(s): query1

I have a unbound combo box on "frmCrit" with a command button that is tied
to "query1" for my search form. On my other form "frmMain" I have a command
button that opens form "frmCrit". <my search form>

When I type within the open box to search for matching records of "table 1"
my search function works "however", it only brings up a table with the
matching record highlighted within the table. It does'nt actually populate
my "frmMain" with all the corresponding record information.

What I am trying to do is basically search records so that if there is a
unique key "-ID" already in existence that the form is populated by the
tables matching records.

It should be noted that my Query Properties have "Unique Records" set to NO.
Should this matter in populating the form?
 
R

Rick B

8 posts is a bit much. Chill out and wait for an answer. Someone will get
back to you.

You should try to not post the same question in multiple groups. If someone
answers your question in one group, another person might invest their time
and effort into answering it in the other group. This means two people
spend time (oftne giving the same answer).
 
B

Big Tom Tuttle

My windows browser kept closing on me. I appologize for all the multi-posts.
I wasnt sure I was getting it actaully posted. When I did see they were in
fact posted....uh' yeah.. I felt bad. But no way to take them off :(
 
P

pmkdatabase_at_yahoo_period_ca

The unique keyword won't make a difference in this situation.

There are a variety of approaches to what you want to do. I prefer to
code the criteria form to hide itself when you start the search, and
code the main form to close the criteria form when it (the main form)
closes.

For the main form filter, you reference the criteria control on the
criteria form (that control could be invisible, if you like) as:
forms!MyForm!Mycontrol

If the main form is bound, then you can just filter it on the primary
key should one be found. If unbound, then you have to open a recordset
and populate the form from that.

Having said all that, you could also do this with one form. Just have
the criteria text box in the top of the form, and on the afterupdate
event or a command button, search for the record. If it exists, filter
the form. If not, go to a new record.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top