Displaying an Image in a Form: Problem with Code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BASSPU03
    New Member
    • Oct 2007
    • 55

    #16
    Originally posted by ADezii
    Try inserting this line of code between Lines 107 and 108, then see what happens.
    [CODE=vb]errormsg.Visibl e = False[/CODE]
    Wha'...? Weird...do you all smell that? Yes, I smell genius. Thanks, ADezii. That seems to have worked perfectly.

    Yet, it appears that the Access gods aren't finished taunting me. I noticed something strange: When there is no image and this same "Click Add/Change..." text is visible, it appears in the very same place on other tabs and right over textbox controls. Any idea how to limit it to the uppermost tab? Thanks.

    Comment

    • ADezii
      Recognized Expert Expert
      • Apr 2006
      • 8834

      #17
      Originally posted by BASSPU03
      Wha'...? Weird...do you all smell that? Yes, I smell genius. Thanks, ADezii. That seems to have worked perfectly.

      Yet, it appears that the Access gods aren't finished taunting me. I noticed something strange: When there is no image and this same "Click Add/Change..." text is visible, it appears in the very same place on other tabs and right over textbox controls. Any idea how to limit it to the uppermost tab? Thanks.
      That's a strange one, but you can apply a Band Aid until you figure it out. It may actually work. In the Change() Event of your Tab Control:
      [CODE=vb]
      Private Sub <Your Tab Control Name>_Change()
      'If no Photo, and the 1st Tab is Active
      If IsNull(Me!Photo ) And Me![<Your Tab Control Name>].Value = 0 Then
      Me![errormsg].Visible = True
      'If no Photo, and the 1st Tab is Not Active, make Label invisible
      ElseIf IsNull(Me!Photo ) And Me![<Your Tab Control Name>].Value <> 0 Then
      Me![errormsg].Visible = False
      Else 'must be a Photo!
      Me![errormsg].Visible = False
      End If
      End Sub[/CODE]

      Comment

      • BASSPU03
        New Member
        • Oct 2007
        • 55

        #18
        Yeah, this works just fine. I should have a week dedicated to troubleshooting next week, so I'll see what I can come up with. Thanks again!

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          #19
          Originally posted by BASSPU03
          Yeah, this works just fine. I should have a week dedicated to troubleshooting next week, so I'll see what I can come up with. Thanks again!
          Always glad to help you.

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #20
            The only reason I see for the label to appear on other tabs is because the control was created on the form and not on the tab so it's free floating and not associated with any of the pages.

            Comment

            • ADezii
              Recognized Expert Expert
              • Apr 2006
              • 8834

              #21
              Originally posted by Rabbit
              The only reason I see for the label to appear on other tabs is because the control was created on the form and not on the tab so it's free floating and not associated with any of the pages.
              Hello Rabbit, I think you hit the nail on the head! If you overlay a Tab Control onto a Label, and Send the Label to Front, the exact behavior as the OP described occurs.

              Comment

              • BASSPU03
                New Member
                • Oct 2007
                • 55

                #22
                Originally posted by ADezii
                Hello Rabbit, I think you hit the nail on the head! If you overlay a Tab Control onto a Label, and Send the Label to Front, the exact behavior as the OP described occurs.
                Yeah, I was pretty sure that was the problem. So, while I'm content with your fantastic codes, I just might insert the code into the tab instead of in the main form...if I'm brave enough.

                Comment

                Working...