Results 1 to 7 of 7

Thread: Report problem

  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have the following code in the Open event of a report:

    Me.ClientReference.Visible = Forms![frmMain]![chkIncldMnfstDtls].Enabled
    Me.lblClientReference.Visible = Forms![frmMain]![chkIncldMnfstDtls].Enabled

    I get no errors, but the textbox and label never get disabled no matter what I do. I ran the de######, the code is being executed in the event. What am I doing wrong or what don't I understand?

    Any help is appreciated.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Do you want the controls to be visible if the check box is ticked and hidden if the check box is clear? If so, you should use the Value property of the check box instead of its Enabled property - Enabled specifies whether the user can click on the check box, not whether it is ticked.

    Me.ClientReference.Visible = Forms![frmMain]![chkIncldMnfstDtls].Value
    Me.lblClientReference.Visible = Forms![frmMain]![chkIncldMnfstDtls].Value

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah, that's exactly what I'm trying to do. The checkbox is on a form that I run the report from. I had tried .Value with no success. I changed it back to .Value from .Enabled, but still no luck. I have the labels and textboxes set to Invisible by default. I know I must be missing something stupid, but I don't see it.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You could try using the On Format event of the report section that contains the two controls instead of the On Open event of the report as a whole.

  5. #5
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Still the same thing. I added an IF statement in the Format event, the checkbox value is referenced correctly, it comes accross correctly. The visible property of the labels and text boxes is not changing though. When in the VBA editor, the .visible doesn't come up as part of the autocomplete, that have anything to do with it?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Could you post a stripped down copy of your database? See post 401925 for instructions.

  7. #7
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just figured it out. I hard coded each label and text box (there were actual several, I just listed a couple for an example) to False and compiled. I got an error "Invalid Qualifier", never saw that error before. One of the bound text boxes was named "Name", the compiler was, I'm assuming, bouncing the control name as a reserved word. Anyway, changed to control name, saved and recompiled and now all works.

    Thanks for all the help Hans...

Posting Permissions

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