Using the Me.RecordSource Command

M

Melanie H.

First of all, I would like to thank the community I could not have written my
database without the help I received. This is my first database; I am a new
user. New to Access and new to VBA. My database has 8 tables, 2 forms, 4
subforms and 2 queries. I have a form to enter data and one to extract data.
My question focuses on the data extraction form.

This is form is linked to 2 queries. Query #1, "Prep_All_Query" was created
for the purpose of alphabetizing/numberically sorting a couple columns of
data. In Query #2, the "Prep_Condensed_Query" I have sorted
numberically/alphabetically and set my total to First on several columns to
eliminate duplicates. Not duplicate records, just wanting to condense my
list showing the first of each particular document. (The columns set to
First are not part of the search parameters it is the information I am
wishing to obtain.) A main document may have up to 10 other documents
associated with it. All associated documents have hyperlinks. Sometimes the
user may want to know a document name and sometimes they may be looking to
open the associated document. Sometimes they may just change their mind.

I have a couple of command buttons that use:

Me.RecordSource = "Prep_Condense_Query"

and a second button to return to the first Query

Me.RecordSource = "Prep_All_Query"

Every time I reset the recordsource I loose the search criteria in my combo
boxes. How do I get those boxes to retain their entries? So, the user can
depress the "Condense List" button and using the parameters already entered
get their results, without having to re-enter search parameters.

Mel
 
S

S.Clark

Unfortunately, you didn't describe anything about the comboboxes.

If all else fails, create global variables to hold the last selected values.
Then, after the data refresh occurs, set the combo boxes to the values in
the global vars.
 

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