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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering Null Values 1

Status
Not open for further replies.

pgfe

MIS
Nov 16, 2006
2
GB
Hi,

I hope someone may be able to point me in the right direction.

I have db with various tables, one holding address details.

From this table I have created a form to list records from that table, on the form I have three combo boxes, cboCountry, cboCounty and cboPCode which I use to filter required Country, County and Post Code records.

I do this by using DoCmd.Applyfilter, I am however finding it difficult to find a way to filter any records where one of these fields is null.

Any help would be greatly appreciated.

Regards

Paul
 
Me.filter = "txtPCode Is Null"

Me.filter = "txtPCode & '' = ''"

Me.filterOn = true
???
 
I do not think that the field in your table is called txtPcode.

Try:
Me.Filter = "Trim([Name of Field] & "" "") = """""
 
Sorry Zion7, I thought your post was a reply from the OP :(
 
No worries Remou,
my brief response i'm sure, made it look that way.

Paul, more specifically

DoCmd.ApplyFilter , "txtCountry= '" & cboCountry & "'" & _
" AND txtCountry & '' <> ''"
 
Hi Remou & Zion7,

Many thanks to you both that little problem is now resolved and it's fair to say that all the threads were helpful, they made me think about how I deal with another couple of issues. Sometimes you get bogged down trying to be clever when simplicity is the way forward.

Once again many thanks.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top