Clear Form In Access

spike250

Registered User.
Local time
Today, 19:05
Joined
Aug 6, 2009
Messages
70
Hi All,

I have an unbound form with the following items.
Combo Box
x2 Text Box for Date Input
Search Button
Cancel Button

When you select an item from the combo box and enter the start date and end date and click search it runs a query to show the records.

The problem I have is that when you go back into the form it still shows the last details you search for until you press cancel which closes the form.

Is there any way of getting it to clear the details either after the search has been run or when the form loads.

I have tried putting the following code behind the on load event
Me.Refresh but nothing happens.

Any help would be appreciated.

Spike
:confused::confused::confused:
 
the way to do this is set it up so the query that drives the form shows no results - ie pick a filter that cant exist, or something like that.

eg set these values in the form's open event, and immediately requery the form itself (me.requery)
 
Something I do sometimes is create a "Clear Fields" button.

Behind it's 'on click' event I put things like;

txtstartdate = isnull
txtenddate = isnull
cboYourCombo = isnull
etc
etc

This clears the form. However, this is better if the form is to remain open and users get multiple results for it.

Might not suit you in this case though.
 
Hi,

Is there any way to get it to clear the previous contents when the form gets opened.

the way to do this is set it up so the query that drives the form shows no results - ie pick a filter that cant exist, or something like that.

eg set these values in the form's open event, and immediately requery the form itself (me.requery)

I am not sure how to go about starting the above.

Any further help would be great.

Spike
:confused::confused::confused:
 

Users who are viewing this thread

Back
Top Bottom