PDA

Click to See Complete Forum and Search --> : Displaying records which do not have a blank field


Rick B
Feb 11th, 2000, 12:09 AM
Can anyone help me. I hace a DB set up and it works fine exept for one area.

When a user selects a check box and its value is true how do I get the record to display if one of the fields has data sved in it.

It's kinda foxed me...

Thanks
;)

bsmith
Feb 11th, 2000, 12:31 AM
I am not clear what you are trying to do. Do you want to select the record from the DB and display the results?

Rick B
Feb 11th, 2000, 01:21 AM
Yeah sorry, it isn't clear is it.

When a user is browsing through the database he/she might only want to view records that match a certain criteria. i.e. if the checkbox on the form is selected then only show records that, lets say paid there subscription.

What I want the database to do is only show those records which satisfy the criteria governed by the checkbox....

I hope thats a little clearer...thanks

raicheman
Feb 11th, 2000, 02:40 AM
It is still not real clear what your looking for. What I would do, with how I understand the problem, is use SQL to define the field value that you wish to sort on and then display the data.
Example:
Data1.recordsource = "Select * from Database where checkboxfield = 'Paid'"
Data1.Refresh

Rick B
Feb 11th, 2000, 03:43 AM
That works fine if the expected text in the field is 'paid'.

The DB should only show the record if there is something in the field....that is to say, if while browsing through the records

data1.recordset.fields(7) has an entry, then show this record. If field(7) is empty, nul, then do not show the record...

Is that any clearer..

Thanks again, sorry about this I havn't done any code for about a year now and just starting to get back into it.

:)

DrewDog_21
Feb 12th, 2000, 06:01 AM
Try this SQL:

If chkPAID.Value = Checked then

Data1.RecordSoure = "SELECT * FROM <table name> WHERE <field name> IS NOT NULL"

Data1.Refresh

------------------
Andrew Nerney
Hapless Programmer
DrewDog_21@yahoo.com