Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / December 2005

Tip: Looking for answers? Try searching our database.

Clear Query Results

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ridawg - 13 Dec 2005 14:15 GMT
Hey,

I've created a form connected to an Access database using the connection
wizard. Within this form I've created 3 views: Search, Details, New Record.

The Search view has a button that switches views to the New Record view,
query fields & query button, and a repeating table for the results & within
the results I have a button that I use to switch views to the Details view.

Here's the problem:
When I enter a new record in the New Record view the database is updated no
problem but I then select a button I created called Return to Search - this
button switches the view back to my Search view - this is where the problem
occurs.

The Search view lists my new record - I would like the Search view to be set
back to nothing like when you first open the form. The reason being the next
time I select the New Record button it displays my new record instead of
switching to this view with all the fields blank (essentially ready for
entry).

So I think I need to write some code that when my Return to Search button is
clicked it not only switches to the Serach view but it also clears the
previous results.

Any help is greatly appreciated!

Signature

-ridawg

S.Y.M. Wong-A-Ton - 13 Dec 2005 15:01 GMT
How about adding a rule to your Return to Search button that sets the fields
on the Search view to their initial values? Create a rule on the button,
select "Set a field's value", select the field on the Search view you would
like to reset, and enter "" (an emptry string) for text fields or enter a
formula if desired for other types of fields.

Regards,
S.Y.M. Wong-A-Ton

> Hey,
>
[quoted text clipped - 22 lines]
>
> Any help is greatly appreciated!
ridawg - 14 Dec 2005 16:20 GMT
Thanks for this idea but I already tried that. This will set the query fields
back to their initial values but it doesn't actually clear the results of the
initial query or prevent the my new record being returned in my results
section. I did find a solution that solves this problem. Basically using a
button with it's action set to New Record. After entering a new record and
submitting it, you can then click on the return to search button (with it's
action set to new record) and it will by default switch to the form's default
view and clear the query results fields (what infopath calls datafields).

Signature

-ridawg

> How about adding a rule to your Return to Search button that sets the fields
> on the Search view to their initial values? Create a rule on the button,
[quoted text clipped - 31 lines]
> >
> > Any help is greatly appreciated!
 
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.