A form's window position - something I always wanted to know...

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

Guest

Hi there,

I've been developing access apps (and VBA) for sometime and never managed to
figure out how to read in code the x and y postion of an open form. I tried
several
times in the past but always gave up.

I've got around it by postioning form A before opening B, never was happy
with that.

Any ideas would really be appreciated and many thanks already in advance...

Have a nice day...
Michael


PS: Someone mentioned Me.WindowTop and Me.WindowLeft but I believe these
commands are VB and not VBA as they don't work with Access (97)...
 
take a look at the WindowLeft Property topic, the WindowTop Property topic,
and the Move Method topic, in Access VBA Help.

hth
 
Hi Tina, just had a look at Access VBA Help again and I can't find any
references to WindowLeft or WindowTop. I did however find the Move Method
topic.

Cheers
Michael
 
hmm, well, i'm using Access 2003. it's possible those form properties aren't
available in earlier versions. try the following: open your form's module.
put your cursor inside of any procedure, on a blank line, and type

me.win

the Properties/Methods droplist should open as soon as you type the "dot",
and automatically scroll down as you type the "win". if the properties in
question aren't listed in the droplist, then i'd guess they're not available
in the version of Access you're using. if you find one, then select it.
backspace once to put your cursor "inside" the word, and press F1, that
should take you right to the Help topic.

hth
 
In earlier versions you have to use the Windows API
to get the positions:

Call GetWindowRect(frm.hWnd, lpRect)


Also, the values you get from the Windows API aren't
always usable without further processing. For this
reason most examples only work with pop-up forms.


I haven't tried the A2003 methods, but if you've
gotten this far without using the API, I would
consider waiting until your next upgrade before
doing any coding.

(david)
 
Are you the same Michael that asked this question on the 15th? If so, didn't
you say then that you were using Access 97?

I'm afraid I can no longer help with Access 97 questions, but someone with
more recent experience of using Access 97 may be able to do so.
 
Michael said:
Hi Tina, just had a look at Access VBA Help again and I can't find any
references to WindowLeft or WindowTop. I did however find the Move
Method topic.

Those properties weren't available in Access 97, I think. But Nicole
Calinoiu has provided a class object to manipulate window positions, and
it works with Access 97. See this link:

http://www.mvps.org/access/forms/frm0042.htm
 
Thanks to all of you for the time taken to help me...

I know now that this method is not available in Access 97
I do have Access 2003 but it's not yet my main app dev environment
So I'll wait till then...

Thanks again
Cheers
Michael
 
Back
Top