Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Colorado, USA
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've got a continuous form with a checkbox on it that, if checked, displays a date/time control. If it is unchecked, the date/time control is hidden. The problem is that when the user checks or unchecks the checkbox, the date/time control on all the records on the form are displayed or hidden. I'm using code like Me.dtmDateComplete.Visible = True to display the control, for example, when the checkbox is clicked. How should the code be changed to make it only affect the row being edited?

    Thanks
    Bill Lugg

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    A continuous form contains only one set of controls regardless of how many records are displayed. So if you hide a control, it will be hidden in all records.

    You might use conditional formatting to disable/enable the control depending on the state of the check box. Conditional formatting does work on a record-by-record base.

  3. #3
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Colorado, USA
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='790633' date='25-Aug-2009 13:44']A continuous form contains only one set of controls regardless of how many records are displayed. So if you hide a control, it will be hidden in all records.

    You might use conditional formatting to disable/enable the control depending on the state of the check box. Conditional formatting does work on a record-by-record base.[/quote]

    OK,
    I'm trying this and it appears the best I can do is disable the txtDateComplete control if the chkComplete control is not checked. So I entered two conditions the first being "[chkComplete] = False" (without the quotes) and set the format to disabled. The second condition is "[chkComplete] = True" and the format is enabled. I set the default condition to fill the field red so I could tell which it is selecting. No errors are being reported and all the fields are red, so it apparently isn't evaluating any of my condiditons correctly. Any idea what I might be doing wrong? I've never used this before, and the help seems to be a bit cryptic, so I'm fishing around in the dark a bit.

    Thanks for the help.
    Bill Lugg

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Is the check box bound to the field in the record source of the continuous form? It should be, otherwise you won't be able to tick the check box in individual records.

  5. #5
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Colorado, USA
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='790655' date='25-Aug-2009 15:38']Is the check box bound to the field in the record source of the continuous form? It should be, otherwise you won't be able to tick the check box in individual records.[/quote]

    Yes, all the controls are bound to their corresponding fields in the table that provides the data source. FWIW, the data field name for the field in question is blnComplete. I wanted to make sure the names were different so Access wouldn't get confused. How does that affect the problem I seem to be having?

    Thanks.
    Bill Lugg

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    It shouldn't matter whether you use chkCompleted or blnCompleted - either should work OK.

    Could you post a copy of your database?
    • Make a copy of the database and work with that.
    • Remove all database objects (tables, queries, forms, reports, macros and modules) that are not relevant to the problem.
    • In the remaining table(s), remove most records - leave only the minimum number necessary to demonstrate the problem.
    • Remove or modify data of a confidential nature.
    • Perform a compact and repair (Tools/Database Utilities).
    • Make a zip file containing the database.
    • If you have difficulties getting the zip file reasonably small, save the database in Access 97 format and then zip it.
    • Attach the zip file to a reply.

Posting Permissions

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