Help with run time error 2100 (with code)

F

Fred Wilson

The following code is used to maximize my opening form. Additionally I
have an "enter" button to enter the main application. I would like this
button to be approximately .25 inches from the bottom and from the right
of the maximized form.

The LEFT property of the imgEnter control function alright. It gets it
in the correct spot, about .25 inches from the right side of the form.

The TOP property is causing the Run time error 2100
"The control or subform control is too large for this location."


Private Sub Form_Current()

Dim intButtWidth As Variant

Dim intFormWidth As Variant

Dim intButtHeight As Variant

Dim intFormHeight As Variant

Dim intLeft As Variant

Dim intTop As Variant

DoCmd.Maximize

intFormWidth = Forms.Item(Me.Name).WindowWidth

intFormHeight = Forms.Item(Me.Name).WindowHeight

intButtWidth = Me.imgEnter.Width

intButtHeight = Me.imgEnter.Height

intLeft = intFormWidth - (intButtWidth + 360) 'plus 360 twips is approx
..25 inches

intTop = intFormHeight - (intButtHeight + 360) 'plus 360 twips is
approx .25 inches

Me.imgEnter.Left = intLeft

Me.imgEnter.Top = intTop <<< THIS LINE IS ERRORING OUT.

End Sub
 
M

MacDermott

Just a thought -
when you maximize a form, it is displayed filling the screen exactly,
but its Height and Width properties don't change.
Could this be part of your problem?
 
F

Fred Wilson

I have no idea what so ever, This is why I was hoping someone here would
know what I am doing and what would work.
 
B

Brendan Reynolds

This seems to work. Note the line that sets the height of the Detail
section - assuming your control is in the Detail section ...

Private Sub Form_Activate()

DoCmd.Maximize
Me.Detail.Height = Me.InsideHeight
Me.Command0.Top = Me.InsideHeight - Me.Command0.Height - 360

End Sub
 
M

MacDermott

Well pardon me for offering an insight, instead of doing your whole job for
you -
for free!
 
F

Fred Wilson

Mr. MacDermott,

I dang sure was not trying to create offense. I personally value all
information and directions that are offered on this group.

You asked if your suggestion could have been my problem. I really don't
know. Although I can use and make Access do more than the average bear I
am by no means the expert.

Sincerely, thank you for your input.

Fred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top