Error 438 With Access 2000

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Access 2003 formatted for Access 2000-2002. I have a procedure
that will move a control on a report using the Control.Move xPos, yPos which
compiled and worked correctly on machines using Access 2002 and higher. But
when used on Access 2000 an error message 438 Object doesn't support this
property or method appears. What would be the correct syntax or procedure to
use for Access 2000 versions to move a control?

Thanks in advance,
lwells
 
lwells said:
I am using Access 2003 formatted for Access 2000-2002. I have a procedure
that will move a control on a report using the Control.Move xPos, yPos which
compiled and worked correctly on machines using Access 2002 and higher. But
when used on Access 2000 an error message 438 Object doesn't support this
property or method appears. What would be the correct syntax or procedure to
use for Access 2000 versions to move a control?

Thanks in advance,
lwells

You'll have to do it by changing the values of the control's Top and Left
properties.
 
Hi Brian,

Then I take it that access 2000 does not support using vba to move a control
at runtime? Or does the vba code need to be written to change the properties
of the control at runtime. The code that is written is executed in the
Format properties of the report and detail sections when the report is
opened. Depending on another condition the controls are moved in one
direction or another during the formatting process for each record in the
report. The .Move did not work in Access 2000 but does work in 2002-2003
correctly.

Just need to clarify.

Thanks,
lwells
 
The .Move method must have been new in Access 2002. I didn't know it
existed, but since reading your post I've tested, and can confirm that it
does not exist in Access 2000 but does in Access 2003. As Brian says,
changing the Top and Left properties will work, in all recent versions.
(Probably in not-very-recent versions, too, but I have not tested in any
version earlier than 2000). Here's an example ...

Option Compare Database
Option Explicit

Private lngTop As Long
Private lngLeft As Long

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me!TestID Mod 2 = 0 Then
Me!txtTestText.Top = lngTop + 360
Me!txtTestText.Left = lngLeft + 360
Else
Me!txtTestText.Top = lngTop
Me!txtTestText.Left = lngLeft
End If

End Sub

Private Sub Report_Open(Cancel As Integer)

lngTop = Me!txtTestText.Top
lngLeft = Me!txtTestText.Left

End Sub

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Thanks Brendan,

You have been a great help. Now I can restructure the code and get it to
work correctly on the older version.

Great forum,
lwells
 
Brendan Reynolds said:
The .Move method must have been new in Access 2002. I didn't know it
existed, but since reading your post I've tested, and can confirm that it
does not exist in Access 2000 but does in Access 2003.

I also never noticed this new feature, but it does "work" in
A2002 as well.

However, I must say that it's a pretty dumb feature to save
one line of code. Maybe its real intent was to make
MoveSize a method of the form/report objects (in addition to
DoCmd) and they just included controls as an afterthought.
They could have at least made it move an option group as a
whole instead of just the frame.
 
lwells said:
Hi Brian,

Then I take it that access 2000 does not support using vba to move a control
at runtime? Or does the vba code need to be written to change the properties
of the control at runtime. The code that is written is executed in the
Format properties of the report and detail sections when the report is
opened. Depending on another condition the controls are moved in one
direction or another during the formatting process for each record in the
report. The .Move did not work in Access 2000 but does work in 2002-2003
correctly.

Just need to clarify.

Thanks,
lwells

All that the .Move method does is give you a shorthand way of changing the
values of the Top and Left properties. It didn't exist in A2000, so you
have to do it the (not so) hard way.
 
Back
Top