Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / October 2005

Tip: Looking for answers? Try searching our database.

Opening Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
baconroll - 17 Oct 2005 14:06 GMT
Does anybody know how to open a form in Filter Mode? I have a form with lots
of records set to dataentry mode. I want the form to open and immediately go
to FilterByForm mode. Any help would be greatly appreciated.
Thanks
'69 Camaro - 17 Oct 2005 14:17 GMT
> I want the form to open and immediately go
> to FilterByForm mode.

In the form's OnOpen( ) event, try:

Private Sub Form_Open(Cancel As Integer)

   On Error GoTo ErrHandler
   
   RunCommand acCmdFilterByForm
       
   Exit Sub
   
ErrHandler:
   
   MsgBox "Error in Form_Open( ) in" & vbCrLf & _
       Me.Name & " form." & _
       vbCrLf & "Error #" & Err.Number & vbCrLf & Err.Description
    Err.Clear

End Sub

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers.  Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.

> Does anybody know how to open a form in Filter Mode? I have a form with lots
> of records set to dataentry mode. I want the form to open and immediately go
> to FilterByForm mode. Any help would be greatly appreciated.
> Thanks
baconroll - 17 Oct 2005 14:23 GMT
Many thanks, that's great. Have followed your answer request.

> > I want the form to open and immediately go
> > to FilterByForm mode.
[quoted text clipped - 38 lines]
> > to FilterByForm mode. Any help would be greatly appreciated.
> > Thanks
'69 Camaro - 17 Oct 2005 14:48 GMT
You're welcome!  Many thanks!

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

> Many thanks, that's great. Have followed your answer request.
>
[quoted text clipped - 46 lines]
>> > to FilterByForm mode. Any help would be greatly appreciated.
>> > Thanks
baconroll - 17 Oct 2005 14:47 GMT
Sorry, just one more quick question:

How can I stop the form opening with the last filter searched for?
Thanks

> > I want the form to open and immediately go
> > to FilterByForm mode.
[quoted text clipped - 38 lines]
> > to FilterByForm mode. Any help would be greatly appreciated.
> > Thanks
Ofer - 17 Oct 2005 15:20 GMT
Before you running the filter, run me.Filter =""
Private Sub Form_Open(Cancel As Integer)

   On Error GoTo ErrHandler
   me.Filter =""
   RunCommand acCmdFilterByForm
       
   Exit Sub
   
ErrHandler:
   
   MsgBox "Error in Form_Open( ) in" & vbCrLf & _
       Me.Name & " form." & _
       vbCrLf & "Error #" & Err.Number & vbCrLf & Err.Description
    Err.Clear

End Sub

Signature

If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck

> Sorry, just one more quick question:
>
[quoted text clipped - 43 lines]
> > > to FilterByForm mode. Any help would be greatly appreciated.
> > > Thanks
'69 Camaro - 17 Oct 2005 19:11 GMT
Try:

Private Sub Form_Open(Cancel As Integer)

   On Error GoTo ErrHandler

   RunCommand acCmdFilterByForm
   RunCommand acCmdClearGrid

   Exit Sub

ErrHandler:

   MsgBox "Error in Form_Open( ) in" & vbCrLf & _
       Me.Name & " form." & _
       vbCrLf & "Error #" & Err.Number & vbCrLf & Err.Description
    Err.Clear

End Sub

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

> Sorry, just one more quick question:
>
[quoted text clipped - 49 lines]
>> > to FilterByForm mode. Any help would be greatly appreciated.
>> > Thanks
Allen Browne - 17 Oct 2005 14:21 GMT
In Form_Open:
   RunCommand acCmdFilterByForm

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Does anybody know how to open a form in Filter Mode? I have a form with
> lots
> of records set to dataentry mode. I want the form to open and immediately
> go
> to FilterByForm mode. Any help would be greatly appreciated.
> Thanks
baconroll - 17 Oct 2005 15:07 GMT
Thank you for this. Works fine. Is there anyway to clear the last filtered
search when the form opens as well?

> In Form_Open:
>     RunCommand acCmdFilterByForm
[quoted text clipped - 5 lines]
> > to FilterByForm mode. Any help would be greatly appreciated.
> > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.