DoCmd OpenForm parameters

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

Guest

I would like to open a form at the bottom right of my screen. But I don't
see any parameters that would allow me to tell it where to place the box on
the screen. Do parameters such as these exist?
 
You need to look at the MoveSize command in VBA help. You can pass the
values in the OpenArgs argument if needed.
 
RG, I get a error that says "..can't find field '|' referred to in your
expression."

here is the code that I have...
DoCmd.OpenForm "frm_Sort - OBSV Missing"
DoCmd.MoveSize [500], [500], [0], [0]

can you tell me what I am doing wrong here?
Thanks
Denise
 
The MoveSize needs to be in the next form and the syntax is:
DoCmd.MoveSize 500, 500, 0, 0
as they are all numbers.

RG, I get a error that says "..can't find field '|' referred to in your
expression."

here is the code that I have...
DoCmd.OpenForm "frm_Sort - OBSV Missing"
DoCmd.MoveSize [500], [500], [0], [0]

can you tell me what I am doing wrong here?
Thanks
Denise
You need to look at the MoveSize command in VBA help. You can pass the
values in the OpenArgs argument if needed.
 
I did try that initially and it all turned red. And I get a Syntax error,
when in debug it has that line highlighted.

When I type in the command and it shows you the format of DoCmd.MoveSize
(
,[Down],[Width],[Height]). So I tried that and that is when I get the
error that it can't fine '|'.

I have tried it with and without the brackets and parentheses and if I go
ahead and run it like you have shown I get a Syntax error.

Any other ideas? I'm clueless here and ready to get out the hammer! Just
kidding, need a little humor right now.​
 
RG, after playing around I figured it out. I wasn't going to use the height
and width so I didn't need the commas after the down. That is what was
causing the errors. Thanks for all of your help

denise said:
I did try that initially and it all turned red. And I get a Syntax error,
when in debug it has that line highlighted.

When I type in the command and it shows you the format of DoCmd.MoveSize
(
,[Down],[Width],[Height]). So I tried that and that is when I get the
error that it can't fine '|'.

I have tried it with and without the brackets and parentheses and if I go
ahead and run it like you have shown I get a Syntax error.

Any other ideas? I'm clueless here and ready to get out the hammer! Just
kidding, need a little humor right now.

ruralguy via AccessMonster.com said:
The MoveSize needs to be in the next form and the syntax is:
DoCmd.MoveSize 500, 500, 0, 0
as they are all numbers.
 
Try:
DoCmd.MoveSize 1440, 2400, , 2000
in the OnLoad event of the next form. The value is in twips (1440 to the
inch)
I did try that initially and it all turned red. And I get a Syntax error,
when in debug it has that line highlighted.

When I type in the command and it shows you the format of DoCmd.MoveSize
(
,[Down],[Width],[Height]). So I tried that and that is when I get the
error that it can't fine '|'.

I have tried it with and without the brackets and parentheses and if I go
ahead and run it like you have shown I get a Syntax error.

Any other ideas? I'm clueless here and ready to get out the hammer! Just
kidding, need a little humor right now.
The MoveSize needs to be in the next form and the syntax is:
DoCmd.MoveSize 500, 500, 0, 0
as they are all numbers.
 
in Help file context, [] indicates optional arguments, so the brackets
should not actually appear in your code. Neither should the parentheses
evidently. The following appears syntax-error free (and compiles) in my vbe:

In the Open event of "frm_Sort - OBSV Missing"
DoCmd.MoveSize 500, 500, 0, 0

BTW, you sure about Height & Width of zero?? You won't get much of a form
with those settings. If you want to use the form's current H & W settings,
leave them blank, not zero:
DoCmd.MoveSize 500, 500

"..can't find field '|' referred to in your expression."

That's the exact error you get? The appearance of the word 'field' makes me
wonder if the error is related to something else entirely. MoveSize and
"can't find field" just don't make any sense together. Are you sure this
line is causing the error? If you comment it out what happens?

HTH,


denise said:
I did try that initially and it all turned red. And I get a Syntax error,
when in debug it has that line highlighted.

When I type in the command and it shows you the format of DoCmd.MoveSize
(
,[Down],[Width],[Height]). So I tried that and that is when I get
the
error that it can't fine '|'.

I have tried it with and without the brackets and parentheses and if I go
ahead and run it like you have shown I get a Syntax error.

Any other ideas? I'm clueless here and ready to get out the hammer! Just
kidding, need a little humor right now.

ruralguy via AccessMonster.com said:
The MoveSize needs to be in the next form and the syntax is:
DoCmd.MoveSize 500, 500, 0, 0
as they are all numbers.
 
Glad to hear you got it sorted and you are welcome.
RG, after playing around I figured it out. I wasn't going to use the height
and width so I didn't need the commas after the down. That is what was
causing the errors. Thanks for all of your help
I did try that initially and it all turned red. And I get a Syntax error,
when in debug it has that line highlighted.
[quoted text clipped - 12 lines]
 
Back
Top