Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access resolution

Status
Not open for further replies.

AccessDevJunior

Programmer
Apr 14, 2004
81
GB
hya,
i have a form with the code behind it to automatically re-size the forms resolution depending on your windows settings.
I have a list box on the form but when the resolution is made larger the list box does not change with the form as its size is set on the on open event of the form.
I want to be able to code:
if 'windows resolution = 9999' then
me.listox.width = 222
else
if 'windows resolution = 6666' then
me.listbox.width = 111
end if
if anyone could help me with this it would be a great help
 
Hi,

You need to have the code in the Resize event of the form rather than the Open event.
Look at the form.InsideWidth and form.InsideHeight properties for the form as a whole, plus the Height properties of the individual sections of your form, for example:

Forms!frmMyform.Form.Sections(acDetail).Height

to obtain the height of individual sections. Type acDetail into access help to get the constants for other form sections.
The same also applies to reports.

John
 
How are ya AccessDevJunior . . . . .

When assigning values to the [blue]Width/Height/Top/Left[/blue] properties thru VBA, Access uses a unit called [purple]Twips[/purple].

[purple]1 Twip = 1/1440 of an inch[/purple]. Therefore the values you've shown are:

[blue]9999 twips = 6.943 inches
222 tipss = 0.154 inches
6666 twips = 4.629 inches
111 twips = 0.077 inches[/blue]

Have a look at Sizing Software for some great stuff!

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top