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 / July 2008

Tip: Looking for answers? Try searching our database.

How to clear a Search Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ChicagoPete - 30 Jul 2008 14:03 GMT
So I have a VERY simple Access 2007 db to store location of products. I have
a ProdID, ProdName, ProdLocation.
Yes, I used a switchboard wizard that has a few buttons - "Enter new
product", another button to "Search". When I click on the "Search" button it
opens frmSearch - the user fills in the ProdName or ProdID, clicks on a
Search button which opens a split form called frmSearchResults (it's data
source is qrySearch).
On frmSearchResults I have a button that goes back to the "Switchboard" and
another button to "Return to Search".
If you click on "Return to Search" - frmSearch opens but still displays the
values from the last search.

It seems to me that the original frmSearch form is still open in the
background when frmSearchResults opens, so how do I clear ALL fields before
frmSearch opens? Is there an OnLoad or OnOpen event I can use here? Or
OnClose of frmSearch?

For the purpose of this simple db, we decided to use wizards and no code so
as this db moves from dept to dept it should be easy to understand/debug -
nothing fancy here!
Allen Browne - 30 Jul 2008 15:25 GMT
What does the 'go back to Switchboard' button do?

Try adding this at the end of the code:
   DoCmd.Close acForm, Me.Name

You could use the search form's Activate event to set all your unbound
search boxes to Null.

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.

> So I have a VERY simple Access 2007 db to store location of products. I
> have
[quoted text clipped - 22 lines]
> as this db moves from dept to dept it should be easy to understand/debug -
> nothing fancy here!
ChicagoPete - 30 Jul 2008 16:11 GMT
Hey Allen,
"Go back to Switchboard"  from frmSearchResults was intended to take the
user back to frmSearch to perform a new search. So we would like the form to
be blank again...

> What does the 'go back to Switchboard' button do?
>
[quoted text clipped - 30 lines]
> > as this db moves from dept to dept it should be easy to understand/debug -
> > nothing fancy here!
Allen Browne - 30 Jul 2008 16:27 GMT
I'm asking what code is in the event that takes you back to the
*switchboard*.

Try adding the line to the end of that code.

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.

> Hey Allen,
> "Go back to Switchboard"  from frmSearchResults was intended to take the
[quoted text clipped - 39 lines]
>> > understand/debug -
>> > nothing fancy here!
ChicagoPete - 30 Jul 2008 16:46 GMT
Sorry, my misunderstanding...

I used the button wizard and it created the On Click event with an Embedded
Macro of CLOSE form.

AAAHaaa!  So all it is doing is just closing my frmSearchResults form and
since the frmSearch is still open that's why I see my 'old' input.

> I'm asking what code is in the event that takes you back to the
> *switchboard*.
[quoted text clipped - 44 lines]
> >> > understand/debug -
> >> > nothing fancy here!
ChicagoPete - 30 Jul 2008 16:51 GMT
Sorry - just reread my last post.

On frmSearchResults I have the button "Return to Search" - this is my
problem. When clicked it merely closes the frmSearchResults form and since
frmSearch is still open that's why I see my old entries. My intention is when
the button Return to Search is clicked, frmSearch opens with all blank fields
- ready for a new search.

The button "Return to Switchboard" works fine..

Sorry again for the confusion - is it still Monday?

> I'm asking what code is in the event that takes you back to the
> *switchboard*.
[quoted text clipped - 44 lines]
> >> > understand/debug -
> >> > nothing fancy here!
ChicagoPete - 30 Jul 2008 18:03 GMT
I reviewed what the 'button wizard' did and I added some addditional
actions/arguments to open and close the forms as needed.

Thanks again for your time and patience.

> Sorry - just reread my last post.
>
[quoted text clipped - 56 lines]
> > >> > understand/debug -
> > >> > nothing fancy here!
 
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.