Prev: refresh/requery subform
Next: 1 combo box populating more than one field and retaining info to t
From: Me.Frustrated = True on 11 Jan 2010 12:18 I have a pair of functions that resize a form and all of its controls at the click of a button. These are for one of my visually-impaired users who likes his buttons, boxes, and text to be larger. One button resizes all the controls up by a factor of 1.1, the other resizes them all down. I also want to put in a button to return everything to their default sizes. Could anyone please point me in the right direction to restore the default sizes for all controls, the "Detail", "Header", and "Footer" sections of a form? Thanks in advance.
From: John W. Vinson on 11 Jan 2010 12:44 On Mon, 11 Jan 2010 09:18:01 -0800, Me.Frustrated = True <MeFrustratedTrue(a)discussions.microsoft.com> wrote: >I also want to put in a button to return everything to their default sizes. >Could anyone please point me in the right direction to restore the default >sizes for all controls, the "Detail", "Header", and "Footer" sections of a >form? Thanks in advance. Constantly resizing controls and saving a form will rapidly bloat your database. I'd really suggest using a Split Database (this is a good idea in ANY case), with the forms, reports and code in a frontend linked to a shared backend containing the tables; each user should have their own private copy of the frontend. This would let you provide this user with a custom large-text frontend, while other users have a smaller text version. -- John W. Vinson [MVP]
From: Me.Frustrated = True on 11 Jan 2010 15:52 Thanks for your reply John. The database is split properly into FE/BE. Our operators share a desk that has three workstation computers, and any of my 10 operators can log on to any one of the three computers. Because the front ends are saved on each machine rather than in each person's profile, I wanted to allow this user to "magnify" the controls no matter which station he uses during his shift without saving the new dimensions each time he clicks the button. Even if he clicks the button several times to magnify the form and controls, he can then close the form and re-open it and it will be back to normal (the magnified dimensions are not saved.) I just wanted to use a button to display the form at normal size without him having to close/reopen it. I would gladly paste the code I have written if it would help illustrate what I'm looking for. Mike "John W. Vinson" wrote: > On Mon, 11 Jan 2010 09:18:01 -0800, Me.Frustrated = True > <MeFrustratedTrue(a)discussions.microsoft.com> wrote: > > >I also want to put in a button to return everything to their default sizes. > >Could anyone please point me in the right direction to restore the default > >sizes for all controls, the "Detail", "Header", and "Footer" sections of a > >form? Thanks in advance. > > Constantly resizing controls and saving a form will rapidly bloat your > database. I'd really suggest using a Split Database (this is a good idea in > ANY case), with the forms, reports and code in a frontend linked to a shared > backend containing the tables; each user should have their own private copy of > the frontend. This would let you provide this user with a custom large-text > frontend, while other users have a smaller text version. > -- > > John W. Vinson [MVP] > . >
From: John W. Vinson on 11 Jan 2010 15:59 On Mon, 11 Jan 2010 12:52:01 -0800, Me.Frustrated = True <MeFrustratedTrue(a)discussions.microsoft.com> wrote: >Thanks for your reply John. > >The database is split properly into FE/BE. Our operators share a desk that >has three workstation computers, and any of my 10 operators can log on to any >one of the three computers. Because the front ends are saved on each machine >rather than in each person's profile, I wanted to allow this user to >"magnify" the controls no matter which station he uses during his shift >without saving the new dimensions each time he clicks the button. > >Even if he clicks the button several times to magnify the form and controls, >he can then close the form and re-open it and it will be back to normal (the >magnified dimensions are not saved.) I just wanted to use a button to >display the form at normal size without him having to close/reopen it. > >I would gladly paste the code I have written if it would help illustrate >what I'm looking for. That would probably help. The only way I can think of would be to store the current magnification scale in a VBA variable so that you can "undo" it, or to store the default dimensions similarly. -- John W. Vinson [MVP]
From: Me.Frustrated = True on 11 Jan 2010 16:48 Here is my code to "magnify." Apologies in advance, I'm not much of a programmer and there's probably a much easier way to do this: *** code start *** Public Function ResizeUp() On Error GoTo err_blocker Dim strForm As Form Dim ctl As Control Set strForm = Screen.ActiveForm With strForm .Width = strForm.Width * 1.1 .Detail.Height = strForm.Detail.Height * 1.1 .FormHeader.Height = strForm.FormHeader.Height * 1.1 .FormFooter.Height = strForm.FormFooter.Height * 1.1 End With RunCommand acCmdSizeToFitForm For Each ctl In strForm.Controls If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox _ Or ctl.ControlType = acLabel Or ctl.ControlType = acCommandButton Then ctl.Height = ctl.Height * 1.1 ctl.Width = ctl.Width * 1.1 ctl.FontSize = ctl.FontSize * 1.1 ctl.Left = ctl.Left * 1.1 ctl.Top = ctl.Top * 1.1 End If Next exit_here: Exit Function err_blocker: MsgBox (Err.Number & ", " & Err.Description) Resume exit_here End Function *** code end *** The ResizeUp() function is similar, just goes the other way (smaller.) I just want to allow my operator to easily go back to the original settings. Thanks John! "John W. Vinson" wrote: > On Mon, 11 Jan 2010 12:52:01 -0800, Me.Frustrated = True > <MeFrustratedTrue(a)discussions.microsoft.com> wrote: > > >Thanks for your reply John. > > > >The database is split properly into FE/BE. Our operators share a desk that > >has three workstation computers, and any of my 10 operators can log on to any > >one of the three computers. Because the front ends are saved on each machine > >rather than in each person's profile, I wanted to allow this user to > >"magnify" the controls no matter which station he uses during his shift > >without saving the new dimensions each time he clicks the button. > > > >Even if he clicks the button several times to magnify the form and controls, > >he can then close the form and re-open it and it will be back to normal (the > >magnified dimensions are not saved.) I just wanted to use a button to > >display the form at normal size without him having to close/reopen it. > > > >I would gladly paste the code I have written if it would help illustrate > >what I'm looking for. > > That would probably help. The only way I can think of would be to store the > current magnification scale in a VBA variable so that you can "undo" it, or to > store the default dimensions similarly. > -- > > John W. Vinson [MVP] > . >
|
Next
|
Last
Pages: 1 2 Prev: refresh/requery subform Next: 1 combo box populating more than one field and retaining info to t |