Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear filter BEFORE opening QBF

Status
Not open for further replies.

ChrisTheAncient

Technical User
Dec 22, 2002
169
0
0
GB

Working on my nice little database in Access XP.

I have a well-working Query by Form facility that (seemingly) does all I want it to do.

Except...

When a new QBF starts, the form seems to remember the last query.

Is there a way of opening a new QBF which (programmatically) clears the last query on opening?

I bet it's there, but I just can't find it!

TIA

Chris

*************************************
OK, I'm stoopid. But I'm good at it!
*************************************
 
Chris
In the Current event for the QBF form, can you set the various text boxes to Null?
In other words...
Me.text1 = Null
Me.text2 = Null
Me.text3 = Null

Tom
 
Hi THWatson

Had a go at that.

As soon as I start the filter, I get the last entry (still); but, interestingly, when I apply the filter, the form goes blank with no result!

Hmmm...

*************************************
OK, I'm stoopid. But I'm good at it!
*************************************
 
Interesting...

That last one lost me some data!

*************************************
OK, I'm stoopid. But I'm good at it!
*************************************
 
Have you tried to blank your controls in the Load event procedure of the form ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV

Sorry for the delay, I had to go out for a while.

I had a couple of goes at some forms of blanking - but (probably through my inabilities more than anything) didn't seem to have any luck.

The other disadvantage that I hit trying that was that as soon as I went to Start Filter, the last data appeared still. And I was so trying to avoid that.

I can see when I look in the properties of the form in design view, 'Filter' shows the last filter used - so I have this sort of feeling that if there was a way of clearing this as I loaded the QBF, I'd be on my way. But I've not found a way. Yet.

Chris

*************************************
OK, I'm stoopid. But I'm good at it!
*************************************
 
And what about this in the Load event procedure of the form ?
Me.Filter = ""

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Aaahh!!

A bit of progress!

The form opens - with old data visible. But as soon as I click 'Start Filter' the sheet clears.

Now to try and start with a clean sheet!

Chris

*************************************
OK, I'm stoopid. But I'm good at it!
*************************************
 
And what about this in the Load event procedure of the form ?
Me.Filter = ""
Me.FilterOn = True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 

Correction

My mistake...

It opens with all records from the main database (which I suppose is logical!).

Then the

me.filter = ""

clears things on clicking 'Start Filter'.

I could live with this. But...

Is there a way of creating a recordset that is empty on opening and then populating it with the result of the filter?

Chris

*************************************
OK, I'm stoopid. But I'm good at it!
*************************************
 
Simultaneous replies!

Bear with me while I try.

Chris

*************************************
OK, I'm stoopid. But I'm good at it!
*************************************
 
PHV

Can't really see a difference - but I am stoopid!

Chris

*************************************
OK, I'm stoopid. But I'm good at it!
*************************************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top