Open Form from switchboard in Filter by Form mode

J

John C.

I have a simple application in Access 2000 which currently
uses no macro's or special code.

What I want to do is devise a method whereby I can open a
form from the switchboard in Filter by Form mode.

I want to do this so that the form is in Query mode
instead of data entry mode.

Can anyone help with this or an appropriate alternate
method.

(p.s. if this takes a macro or special code, I'll ask that
you help very specifically as I have no coding experience).
 
B

Bob Gardner

If the form is always going to be opened in FilterByForm
mode then you can add some coding in the OnOpen action of
the form similar to what is seen below:

Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenForm "YourFormName", acNormal, "", "", ,
acNormal
DoCmd.RunCommand acCmdFilterByForm
End Sub

Create your switchboard using the switcboard manager and
select the OpenForm option to open the appropriate form.

OR

You can create macro where the first action is OpenForm
(Select your form on the bottom) and the second action is
RunCommand (Select FilterByForm on the bottom). Save the
macro and using the switchboard manager, select the Run
Macro option to call the macro you just created.
 
J

John C.

Hey Now, Now this is what I'm talking about!!! It
worked! I used the macro approach and it worked like a
dream. Very cool, thanks Bob
 

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