Opening a continuous form as acDialog, Access 2002

J

Joseph Ellis

Hello all,

I am trying to open a "Search Results" continuous form in acDialog
mode, but it will only display as a single form.

I have tried:

DoCmd.OpenForm "frmSearchResults", , , "[hhLastName] = ""Klein""",
acFormReadOnly, acDialog

As well as the simpler:

DoCmd.OpenForm "frmSearchResults", WindowMode:=acDialog

as suggested by Allen Browne in an earlier post.

I can sort of work around this by opening the form as a datasheet, but
it makes me unhappy.

I am using Access 2002, though the file I am working on is saved in
Access 2000 format. If this is the source of the problem, I suppose I
would have no difficulty converting it to 2002 format.

Thanks for any suggestions,
Joseph
 
W

Wayne Morgan

Joseph,

I just tried it in the immediate window using Access 2003 with a form set
that is set to Continuous in its Properties sheet and it worked. The file is
in Access 2000 format.

Are you really using

"[hhLastName] = ""Klein"""

or are you trying to concatenate in the value from the form doing the
calling in place of Klein? If the latter, it can be done; please post the
actuall code line.
 
J

Joseph Ellis

Hello all,

I am trying to open a "Search Results" continuous form in acDialog
mode, but it will only display as a single form.

I have tried:

DoCmd.OpenForm "frmSearchResults", , , "[hhLastName] = ""Klein""",
acFormReadOnly, acDialog

As well as the simpler:

DoCmd.OpenForm "frmSearchResults", WindowMode:=acDialog

as suggested by Allen Browne in an earlier post.

I can sort of work around this by opening the form as a datasheet, but
it makes me unhappy.

I am using Access 2002, though the file I am working on is saved in
Access 2000 format. If this is the source of the problem, I suppose I
would have no difficulty converting it to 2002 format.

Thanks for any suggestions,
Joseph

Ok, I've found that the problem does not occur if I open
frmSearchResults BEFORE activating the OpenForm action. So if I open
the form normally, it displays as a continuous form, unfiltered, and
takes up most of the screen. Then when I activate the first OpenForm
action above via a command button in another form, the (already
opened) frmSearchResults opens as an acDialog continuous form. In
this case, it displays all three records where [hhLastName] = "Klein",
but still takes up most of the screen.

There must be a way to make this work the way it's "supposed" to.
 
J

Joseph Ellis

Hello again, Wayne

In working out the instructions you provided me in an earlier post
(I'm having to learn each step as I go), I've made a test form which
is unbound and contains a single command button with the following
code on its OnClick event:

Private Sub cmdOpenForm_Click()
DoCmd.OpenForm "frmSearchResults", , , "[hhLastName] Like
""Kle*""", acFormReadOnly, acDialog
End Sub

Eventually I will replace the "[hhLastName] Like ""Kle*""" with a
string passed from a control on a "real life" form. But for now, this
is what I'm working with as I learn. Does this make a significant
difference?
 
J

Joseph Ellis

Nevermind, I figured it out.

I had inadvertently set the form's window size to a height that only
allowed 1 record to be in view at a time. It was just pure luck. If
it had been displaying, say, 1.5 records at a time, I think I would
have clued in on what was going on a little sooner.

I just assumed that the form's window would resize to accommodate all
the records. Is there a way to do that programmatically?

Hello again, Wayne

In working out the instructions you provided me in an earlier post
(I'm having to learn each step as I go), I've made a test form which
is unbound and contains a single command button with the following
code on its OnClick event:

Private Sub cmdOpenForm_Click()
DoCmd.OpenForm "frmSearchResults", , , "[hhLastName] Like
""Kle*""", acFormReadOnly, acDialog
End Sub

Eventually I will replace the "[hhLastName] Like ""Kle*""" with a
string passed from a control on a "real life" form. But for now, this
is what I'm working with as I learn. Does this make a significant
difference?



Joseph,

I just tried it in the immediate window using Access 2003 with a form set
that is set to Continuous in its Properties sheet and it worked. The file is
in Access 2000 format.

Are you really using

"[hhLastName] = ""Klein"""

or are you trying to concatenate in the value from the form doing the
calling in place of Klein? If the latter, it can be done; please post the
actuall code line.
 
Top