PC Review


Reply
Thread Tools Rate Thread

On Click Refresh

 
 
Anne
Guest
Posts: n/a
 
      6th Jul 2004
Hi! I'm working on a database where I have one form,
called "View Main Records", that houses the information
itself. I also have a "Search Main Records" form that
allows the user to search multiple fields and then the
corresponding records come up from the "View Main Records"
form.
What I need is a way to refresh the "Search Main Records"
form as soon as the results come up in "View Main
Records." This would be some kind of VB code to clear the
form so that after the user browses the results and closes
the other form, s/he could begin a new search without
having to close the search form. Right now I have
Me.Refresh, but I still have to close the search form to
start over. Any ideas?
 
Reply With Quote
 
 
 
 
Dirk Goldgar
Guest
Posts: n/a
 
      6th Jul 2004
"Anne" <(E-Mail Removed)> wrote in message
news:271ca01c46358$e7570c10$(E-Mail Removed)
> Hi! I'm working on a database where I have one form,
> called "View Main Records", that houses the information
> itself. I also have a "Search Main Records" form that
> allows the user to search multiple fields and then the
> corresponding records come up from the "View Main Records"
> form.
> What I need is a way to refresh the "Search Main Records"
> form as soon as the results come up in "View Main
> Records." This would be some kind of VB code to clear the
> form so that after the user browses the results and closes
> the other form, s/he could begin a new search without
> having to close the search form. Right now I have
> Me.Refresh, but I still have to close the search form to
> start over. Any ideas?


From the sound of it, the "Search Main Records" form is unbound, since
it's just serving as a means of generating a filter for the "View Main
Records" form. Therefore, Refresh won't have any effect. I think you
could use code like this, possibly executed by a command button on the
form:

' *** WARNING: AIR CODE ***

Dim ctl As Access.Control

' Disable error-checking, to avoid errors with
' non-data controls.
On Error Resume Next

For Each ctl In Me.Controls

If Len(ctl.DefaultValue) > 0 Then
ctl.Value = Eval(ctl.DefaultValue)
Else
ctl.Value = Null
End If

Next ctl


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's Happening When I Click Refresh? Ross Culver Microsoft ASP .NET 0 7th Aug 2007 05:28 AM
after click refresh Alexander Widera Microsoft ASP .NET 4 18th Oct 2005 03:06 PM
Refresh and Button Click Fabiano Microsoft ASP .NET 2 31st May 2005 03:02 AM
On Click Refresh Anne Microsoft Access Form Coding 6 7th Jul 2004 04:47 PM
re: One click to refresh two frames Jim Buyens Microsoft Frontpage 0 2nd Sep 2003 09:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:33 AM.