Results 1 to 6 of 6

Thread: Displaying records which do not have a blank field

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Yorkshire, UK
    Posts
    20

    Post

    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

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    Springfield, IL
    Posts
    124

    Post

    I am not clear what you are trying to do. Do you want to select the record from the DB and display the results?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Yorkshire, UK
    Posts
    20

    Post

    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

  4. #4
    Junior Member
    Join Date
    Jun 1999
    Location
    St. Louis MO USA
    Posts
    18

    Post

    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

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Yorkshire, UK
    Posts
    20

    Post

    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.





  6. #6
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Post

    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
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width