Results 1 to 5 of 5

Thread: vba code (a2k)

  1. #1
    Star Lounger
    Join Date
    Sep 2003
    Location
    Ocean Gate, New Jersey, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    vba code (a2k)

    I have the following code for a report and would like to modify it to read "Me.Text34.Visible = No Training Hours are Needed."


    Private Sub Report_Activate()
    'Number of TCH still needed water

    If Text34.Text < 0 Then
    Me.Text34.Visible = False
    End If
    End Sub

    <img src=/S/meltdown.gif border=0 alt=meltdown width=15 height=15> I'm going crazy here.
    Any help would be greatly appreciated.

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

    Re: vba code (a2k)

    You probably should have the code in the On Format event of the section containing Text34. But i have trouble understanding what exactly you want to accomplish, and what the problem is.

  3. #3
    Star Lounger
    Join Date
    Sep 2003
    Location
    Ocean Gate, New Jersey, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: vba code (a2k)

    Hans,

    Thanks again for a response and your help. You have helped me out on a few occasions already.

    I have attached the DB. You will see in Rpt Employee TCH Info, using employee number 8, in the report footer "Training Hours Needed" is blank. This is because in vb code I was able to have the text box (Text34 and Text36) not visible based on the <0. Now instead of having it left blank I was thinking a message of "NO TCH Hours Are Needed" in place would be better. Not sure how to do this though.

    I had to put it in the Report_Activate as Text 34 would not aloow for the On Format. Not sure but I believe it's because I have the text box conditionally formatted.

    I hope this explains alittle better, if not I'll repost. Thanks again.
    Attached Files Attached Files

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

    Re: vba code (a2k)

    You don't need code for this. You can use the Format property of Text34 and Text36. The Format property for numeric results can contain up to 4 sections:
    The first for positive numbers
    The second for negative numbers
    The third for zero values
    The fourth for Null (missing) values

    In this case, you only need the first three. You could use this:

    0;"No hours needed";"No hours needed"

  5. #5
    Star Lounger
    Join Date
    Sep 2003
    Location
    Ocean Gate, New Jersey, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: vba code (a2k)

    Thank You very much

Posting Permissions

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