Zoom Boxes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • freddie1437
    New Member
    • Aug 2008
    • 38

    Zoom Boxes

    I have a form that has BadgeID where the user will scan their badge, I inserted a code on enter that has
    Code:
     DoCmd.RunCommand AcCmdZoomBox
    and it works correctly, but my question is there any way to change the title from saying zoom to say the name of the field or any name I would choose?

    Thank you
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    No way that I know of; you'd have to "roll your own!" acCmdZoomBox doesn't have arguments that you can set, like a MessageBox does.

    I have a routine that creates a larger, custom "zoomed" textbox that could be used, but it's a lot trouble to simply replace "Zoom" with another name!

    Linq ;0)>

    Comment

    • freddie1437
      New Member
      • Aug 2008
      • 38

      #3
      Originally posted by missinglinq
      No way that I know of; you'd have to "roll your own!" acCmdZoomBox doesn't have arguments that you can set, like a MessageBox does.

      I have a routine that creates a larger, custom "zoomed" textbox that could be used, but it's a lot trouble to simply replace "Zoom" with another name!

      Linq ;0)>
      How would I go about using a "custom zoomed textbox"?

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        In form Design View:

        Copy and paste your textbox; this will become your “zoom box”
        Move it on your form to he desired location and size it as desired
        Place a label on the form, enter the “title” you want to appear and position so that it abuts the top of the “zoombox”
        With the label selected, goto Properties - Format and in the Back color property enter
        -2147483646 (including the minus sigh)

        Then enter this code:

        Code:
        Private Sub Form_Load()
            'Make the zoombox invisible on loading the form
             YourFieldZoom.Visible = False
             YourFieldZoomLabel.Visible = False
        End Sub
        Code:
        Private Sub YourField_Enter()
            YourFieldZoom.Visible = True
            YourFieldZoomLabel.Visible = True
            YourFieldZoom.SetFocus
            YourFieldZoom.SelStart = 0
        End Sub
        Code:
        Private Sub YourFieldZoom_Exit(Cancel As Integer)
        'Make the zoombox invisible
              Me.AnyOtherField.SetFocus
              YourFieldZoom.Visible = False
              YourFieldZoomLabel.Visible = False
        End Sub
        The fact that you copied and pasted the original textbox means that your "zoom box" has the same Control Source as the original. Anything you do in the "zoom box" is treated just as if you did it in the original textbox.

        -2147483646 is the Windows color ID Code for the Active Window Titlebar. By making it the back color of your label, the label’s back color will be the same color as the primary color you have set for the Active Window Titlebar in your Control Panel. If you use a two-color titlebar, with the colors "fading" from left-to-right, it'll be the same as the leftmost color. If you change the titlebar color in the Control Panel, the label's color will automatically change to the new color.

        Now you jsut need to substitute the actual names of your controls for YourField, YourFieldZoom amd YourFieldZoomLa bel

        Linq ;0)>

        Comment

        • freddie1437
          New Member
          • Aug 2008
          • 38

          #5
          Originally posted by missinglinq
          In form Design View:

          Copy and paste your textbox; this will become your “zoom box”
          Move it on your form to he desired location and size it as desired
          Place a label on the form, enter the “title” you want to appear and position so that it abuts the top of the “zoombox”
          With the label selected, goto Properties - Format and in the Back color property enter
          -2147483646 (including the minus sigh)

          Then enter this code:

          Code:
          Private Sub Form_Load()
              'Make the zoombox invisible on loading the form
               YourFieldZoom.Visible = False
               YourFieldZoomLabel.Visible = False
          End Sub
          Code:
          Private Sub YourField_Enter()
              YourFieldZoom.Visible = True
              YourFieldZoomLabel.Visible = True
              YourFieldZoom.SetFocus
              YourFieldZoom.SelStart = 0
          End Sub
          Code:
          Private Sub YourFieldZoom_Exit(Cancel As Integer)
          'Make the zoombox invisible
                Me.AnyOtherField.SetFocus
                YourFieldZoom.Visible = False
                YourFieldZoomLabel.Visible = False
          End Sub
          The fact that you copied and pasted the original textbox means that your "zoom box" has the same Control Source as the original. Anything you do in the "zoom box" is treated just as if you did it in the original textbox.

          -2147483646 is the Windows color ID Code for the Active Window Titlebar. By making it the back color of your label, the label’s back color will be the same color as the primary color you have set for the Active Window Titlebar in your Control Panel. If you use a two-color titlebar, with the colors "fading" from left-to-right, it'll be the same as the leftmost color. If you change the titlebar color in the Control Panel, the label's color will automatically change to the new color.

          Now you jsut need to substitute the actual names of your controls for YourField, YourFieldZoom amd YourFieldZoomLa bel

          Linq ;0)>
          That worked perfectly, thank you very much! I appreciate all of your help!

          Comment

          • missinglinq
            Recognized Expert Specialist
            • Nov 2006
            • 3533

            #6
            Glad we could help!

            Linq ;0)>

            Comment

            • freddie1437
              New Member
              • Aug 2008
              • 38

              #7
              Originally posted by missinglinq
              Glad we could help!

              Linq ;0)>
              You more than helped! I do have a question though, what if on those same zoom boxes (Combo Box), have it cancel if it doesn't have the text in the list? For example I have a combo box that I zoomed with your help and what I would want to happen is that if it doesn't have the text in the list, have it cancel altogether. The way it stands now is that it's a required field because it updates other fields. Is this possible?

              Comment

              • missinglinq
                Recognized Expert Specialist
                • Nov 2006
                • 3533

                #8
                Sorry, but I have no idea what you're talking about! This is the first time you've said anything about a combobox, which has nothing to do with a zoombox or the code I've given you. You'll have to do a better job of explaining what you mean here.

                Linq ;0)>

                Comment

                • freddie1437
                  New Member
                  • Aug 2008
                  • 38

                  #9
                  Originally posted by missinglinq
                  Sorry, but I have no idea what you're talking about! This is the first time you've said anything about a combobox, which has nothing to do with a zoombox or the code I've given you. You'll have to do a better job of explaining what you mean here.

                  Linq ;0)>
                  Well the zoombox you helped me with is a combo box. Now what I have going here is 3 combo boxes that are all seperate tables that are linked together to create my form. The three combo boxes with your help I was able to make them into zoom combo boxes. They do the exact same thing; however, they zoom to give the person entering information a bigger box to look at. Now everything works perfectly. It zooms like you helped me with, but now I wanted to see if there was a way that I could cancel a new record if the selection the person selected was not in the combo box?

                  For Example, what I am doing is I have a battery database (Forklifts) that when a battery gets scanned in on the database (which is one of my combo box/Zoom Box) the employee is saying they are changing that battery. My only problem is that I have set the combo box to limit to the list which if something I need, but if a battery isn't on the list then the record is going to come up with the error saying that this is a required field and you must enter something. I have not given the employees any accessibility to add to the tables so what could I do so that I wouldn't run into this problem?

                  Comment

                  Working...