Forms and Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there

I am builidng a database that tracks information for individuals across Canada. The country is separated into four areas. For each area, the same information is being collected. I want to use the same set of forms, but just switch the queries that are fed behind them, given the area chosen by the user. Is there a way of doing with without have to create a full set of forms for each area

Regard
Carlee
 
CArlee said:
Hi there,

I am builidng a database that tracks information for individuals across
Canada. The country is separated into four areas. For each area, the
same information is being collected. I want to use the same set of
forms, but just switch the queries that are fed behind them, given the
area chosen by the user. Is there a way of doing with without have to
create a full set of forms for each area?

Regards
Carlee

Carlee,
I hope you have just one table with a field that contains the area.
Then is simply a matter of having the one form using the one table as
it's recordsource.
Add a Combo box at the top (Form Header).
You did say just 4 areas, didn't you!!

Set the Combo RowSource Type to "Value List"
Set the RowSource of the combo box to:
"East","West","North","South"
(or whatever the actual area designations are).

Code the After Update event of the Combo Box:

Me.Filter = "[Area] = '" & Me!ComboName & "'"
Me.FilterOn = true

When the form opens it will display all records.
Select a region from the above combo box and only that region will
display. Edit or Enter New Records as you normally would.
Click the ApplyFilter tool button to show all the records again
(or right-click Remove Filter/Sort).
Select another region when ever you wish.

No need for 4 different queries or 4 different forms... if the data is
all in one table.

Note: While I wrote "one table", if you are using one query (with
related tables), that will work also. Just have the query return all
records.
 
Back
Top