Switchboard determines filter

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

Guest

Can a switchboard control a form filter? For example, my switchboard has 5 buttons that all open the same form. Depending on which of the 5 buttons is pressed, I'd like the form's records to be filtered by a different value, for example
Button 1 - form is filtered for "UserNumber = 1
Button 2 - form is filtered for "UserNumber = 2
etc
(I am familiar with macros if that's necessary.
Thanks!!!
 
Unless you're confident that you understand how the
switchboard works, I wouldn't suggest messing with it.
Any changes you make could cause the 'Switchboard Manager'
utility to not work on your database.

Disclaimer aside, here's how you'd do it. Add a field to
your 'Switchboard Items' table to hold the filter you'd
like to apply. Name it 'Filter'. Populate the field with
your filters

eg) [UserNumber]=1

Modify the 'HandleButtonClick' function of your
switchboard by adding a filter to the following case
comparison...

Case conCmdOpenFormBrowse
DoCmd.OpenForm rs![Argument],,,rs![Filter]

good luck!
-----Original Message-----
Can a switchboard control a form filter? For example, my
switchboard has 5 buttons that all open the same form.
Depending on which of the 5 buttons is pressed, I'd like
the form's records to be filtered by a different value,
for example:
 
Back
Top