By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Zoom Boxes

P: 38
I have a form that has BadgeID where the user will scan their badge, I inserted a code on enter that has
Expand|Select|Wrap|Line Numbers
  1.  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
Sep 17 '08 #1
Share this Question
Share on Google+
8 Replies


missinglinq
Expert 2.5K+
P: 3,532
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)>
Sep 17 '08 #2

P: 38
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"?
Sep 17 '08 #3

missinglinq
Expert 2.5K+
P: 3,532
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:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.     'Make the zoombox invisible on loading the form
  3.      YourFieldZoom.Visible = False
  4.      YourFieldZoomLabel.Visible = False
  5. End Sub
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourField_Enter()
  2.     YourFieldZoom.Visible = True
  3.     YourFieldZoomLabel.Visible = True
  4.     YourFieldZoom.SetFocus
  5.     YourFieldZoom.SelStart = 0
  6. End Sub 
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourFieldZoom_Exit(Cancel As Integer)
  2. 'Make the zoombox invisible
  3.       Me.AnyOtherField.SetFocus
  4.       YourFieldZoom.Visible = False
  5.       YourFieldZoomLabel.Visible = False
  6. 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 YourFieldZoomLabel

Linq ;0)>
Sep 17 '08 #4

P: 38
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:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.     'Make the zoombox invisible on loading the form
  3.      YourFieldZoom.Visible = False
  4.      YourFieldZoomLabel.Visible = False
  5. End Sub
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourField_Enter()
  2.     YourFieldZoom.Visible = True
  3.     YourFieldZoomLabel.Visible = True
  4.     YourFieldZoom.SetFocus
  5.     YourFieldZoom.SelStart = 0
  6. End Sub 
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourFieldZoom_Exit(Cancel As Integer)
  2. 'Make the zoombox invisible
  3.       Me.AnyOtherField.SetFocus
  4.       YourFieldZoom.Visible = False
  5.       YourFieldZoomLabel.Visible = False
  6. 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 YourFieldZoomLabel

Linq ;0)>
That worked perfectly, thank you very much! I appreciate all of your help!
Sep 18 '08 #5

missinglinq
Expert 2.5K+
P: 3,532
Glad we could help!

Linq ;0)>
Sep 18 '08 #6

P: 38
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?
Sep 19 '08 #7

missinglinq
Expert 2.5K+
P: 3,532
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)>
Sep 19 '08 #8

P: 38
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?
Sep 19 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.