Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    8

    Question Unanswered: Rule to check or clear a checkbox

    Hi, I am relatively new to Access. In my database I have a checkbox column that I want to automatically check, dependant on the values of two dates in two other columns. Ex) If date1 >= date2, then check the checkbox. Otherwise, leave it unchecked.

    I am not working with forms, just in datasheet view for data entry.

    Is there a way to do this in the design view using the default value tab? Can you use if statements? I tried a few different things, but kept getting a syntax error no matter what I did.

    If I am not making sense to anyone please don't hesitate to ask for clarification.

    Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    The Default Value is what goes into a new record when it is created, not when other values are entered / when it is committed, so I don't think you can create a default value based on other entries that don't yet exist.

    When you say 'working with datasheet view', you mean a query, right? You can create a calculated field in a query to tell you information about your record, i.e., in your QBE grid, put in [date1] >= [date2]. When you enter both date1 and date2 into your record's field, this will be calculated (you will need to have entered the date and gone to another field on the record).

    Because what you are trying to show is a calculated value based on information already available in your record. You really shouldn't store the extra information in your table. You can provide this information through views (queries), and base reports on said views.
    All code ADO/ADOX unless otherwise specified.
    Mike.

  3. #3
    Join Date
    Feb 2004
    Posts
    8

    Thumbs up

    Thanks for your help, I see that I am going at this the wrong way... Thinking from the wrong perspective.





    Originally posted by HomerBoo
    The Default Value is what goes into a new record when it is created, not when other values are entered / when it is committed, so I don't think you can create a default value based on other entries that don't yet exist.

    When you say 'working with datasheet view', you mean a query, right? You can create a calculated field in a query to tell you information about your record, i.e., in your QBE grid, put in [date1] >= [date2]. When you enter both date1 and date2 into your record's field, this will be calculated (you will need to have entered the date and gone to another field on the record).

    Because what you are trying to show is a calculated value based on information already available in your record. You really shouldn't store the extra information in your table. You can provide this information through views (queries), and base reports on said views.

Posting Permissions

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