Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2004
    Posts
    9

    Cool Unanswered: Changing the value of a Checkbox

    I have a bounded form that has a number of checkboxes on it. If the user checks a box, a -1 is entered into the table field bound to that checkbox. If the box is not checked, the field is left empty. Is there a way to change the input into the table field when the box is checked?

    For example, if they checked the box next to "Monday", Monday would be entered into the field that corresponds to that checkbox in the table instead of -1. If they didn't check the "Monday" checkbox, the Monday field in the table would be left blank.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Why would you do that?

    if you have a field for monday in the table that is either yes or no, then it SHOULD be a bit. If you want to display it as text later, do so at the report/form level.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    maybe this is just a stupid spaniel barking up the wrong tree, but consider the following:

    in your table, have a field FldMyDay ...Byte (1=Mon, 2=Tue etc ...7)

    in your form have a group ( !!! use the control wizard) of radio-buttons (called Mon Tue Wed, values 1, 2, 3). this group will return 1...7 depending which button is selected.

    the group.value and the table field can talk to each other quite happily.

    izy
    currently using SS 2008R2

  4. #4
    Join Date
    Jun 2004
    Posts
    9

    Cool

    Forgive me I'm really new at this. The form is filled out by a student each week. Other than their name and other information, the student checks the days of the week they were in the lab. A report is then printed at the end of each month. It will have at least 4 lines per student and each line could have one, two or seven days listed for a week. Even though the data comes from different fields in the table, I would like it to be entered in the same collumn on the report, just expanding the size of the line if it needs to. Does this make sense?

  5. #5
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    ok - then forget my suggestion: it allows only one day selected. izy
    currently using SS 2008R2

  6. #6
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by RShoe
    Forgive me I'm really new at this. The form is filled out by a student each week. Other than their name and other information, the student checks the days of the week they were in the lab. A report is then printed at the end of each month. It will have at least 4 lines per student and each line could have one, two or seven days listed for a week. Even though the data comes from different fields in the table, I would like it to be entered in the same collumn on the report, just expanding the size of the line if it needs to. Does this make sense?
    How about a ComboBox with the days in it??

    Bud

  7. #7
    Join Date
    Jun 2004
    Posts
    9
    That won't work either because they have to be able to pick more than one day. See they only fill this out once a week and they may have been in the lab many days that week. For tracking, the actual day needs to be known, not just the number of days.

  8. #8
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    sounds like your table structure is a little funny.

    You may want to consider a seperate table to track days students were in the lab.

    Eg:

    tblLabDays:
    --------
    lbdayID: integer (pk)
    studentID: integer (fk)
    daykey: integer
    labweekid: integer (fk)

    tblLabWeeks:
    labweekid: integer (pk)
    startdate: datetime


    I don't know EXACTLY what you have for a table structure, so this may not work. Depends on how you are currently setup, and what you need from this information.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  9. #9
    Join Date
    Jun 2004
    Posts
    9
    I'll play with that a little. Thanks for the quick help!

Posting Permissions

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