Help with run time error 2100 (with code)

  • Thread starter Thread starter Fred Wilson
  • Start date Start date
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
 
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?
 
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.
 
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
 
Well pardon me for offering an insight, instead of doing your whole job for
you -
for free!
 
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
 
Back
Top