Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Yes/No field ? (Access 2000)

    In my table exams i want to use the yes/no function in order to arrange the dates after the session,but it seems that the Yes/No function does not accept arrangement after a date.What is the reason? Actually i want to cut off all the dates before the exam with the Yes/No field.I can do it if i use the date field, but i would like to ask, is it possible with the Yes/No field?

    SELECT exams.StudentNumber, exams.examdate, exams.session
    FROM exams
    WHERE (((exams. session)>True));

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Yes/No field ? (Access 2000)

    What do you mean by "the exam with the Yes/No field"? If your table has a Yes/No field, ALL records in the table have a Yes/No field.

  3. #3
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Yes/No field ? (Access 2000)

    What I mean is that if I click in the query on the yeas/no field, which means WHERE (((exams. session)>=True)); to get the dates only after this True record. I somehow have to tie up this field with the examdate.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Yes/No field ? (Access 2000)

    You could use a nested query

    SELECT StudentNumber, examdate, session
    FROM exams
    WHERE examdate > (SELECT Max(examdate) FROM exams WHERE session=True);

  5. #5
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Yes/No field ? (Access 2000)

    Super !! Thats is what i wanted ! How can i create the field but in such a way as to
    obtain the True and False instead of Yes and No ? I have to format it to True/False
    but writing "True/False" in the line below seems not to be the right way.I am sending the code
    in another town.


    ' set additional field properties
    Set fld = tdf.Fields("session")
    fld.Properties("DefaultValue") = "= False"
    Set prp = fld.CreateProperty("Format", dbText, "Yes/No") - how shall i write the "True/False" here ?
    fld.Properties.Append prp

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Yes/No field ? (Access 2000)

    You can set the format in design view, since this is a one-time action there is no need to use code.

Posting Permissions

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