Dialog form opens wrong

A

accesswanabe

I have a form that I am trying to use as a modal dialog. I have the form's
PopUp and Modal properties set to Yes. I open the form using vba with the
following: DoCmd.OpenForm "frmInvoiceItemsforDaily", , , , , acDialog

I also have the form's Border Style set to Sizeable. This is because I
would like the dialog to be a certain size. When I save the form in form
view after sizing it the way I want, the next time the code runs, the form
displays as intended. The very next time the code runs, the form becomes
tiny...no data or fields are visible. Not sure what to do about this problem.

Anyone have any ideas?
 
J

Jack Leach

When opening a form using DoCmd.OpenForm acDialog, you do not need the Modal
and Popup properties of that form to be set. I don't know if this is causing
the issue, but you may want to try it without them on.

Check the AutoResize property of the form as well... this should
automatically resize the form to whatever it's saved during design view.

If you really want to force the form to be a certain size, set each form
section Height property, and the form Width property in the Open event...

Me.Section("Header").Height = SomeNum
Me.Section("Detail").Height = SomeNum
Me.Section("Footer").Height = SomeNum
Me.Width = SomeNum

note that VBA uses Twips as it's unit... 1/20th of an imperial inch.
Therefore, 1inch = 1440 Twips


hth
--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
A

accesswanabe

Thanks Jack, one very important thing I realize I forgot to mention is that
it is a continuous form, so resizing section heights doesn't seem to be an
option. Basically, I have a form that collects timesheet information for
various trades. From that form I a have a button that opens this particular
dialog form to show invoiceable items for the timesheet. Before the form
opens, I create the underlying table for the dialog form with queries that
analize the data on the timesheet form for invoiceable items. The number of
records for each timesheet can be substantially different. For example, a
welder's timesheet might have one invoiceable item while a laborer's might
have several invoice items. I want to show these items in a list and that is
why I thought it would be best to use a continuous form. Do you have a
recommendation for a solution for a form that would do this?
 
J

Jack Leach

I don't often use continuous forms myself, but I'm wondering if you can do
this using a subform. Make an unbound form to hold a subform (that would be
your continuous form). I think this way you might get a bit more control
over the unbound mainform, as well as the size of the subform control that
will dictate how your user see's the information.

Maybe there's a simpler solution than this. Having an extra form just for
sizing reasons does seem a bit much, but I'm really not that versed with
continous forms so I don't know their quirks.

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
A

accesswanabe

Thanks Jack. I sure appreciate your help.

Jack Leach said:
I don't often use continuous forms myself, but I'm wondering if you can do
this using a subform. Make an unbound form to hold a subform (that would be
your continuous form). I think this way you might get a bit more control
over the unbound mainform, as well as the size of the subform control that
will dictate how your user see's the information.

Maybe there's a simpler solution than this. Having an extra form just for
sizing reasons does seem a bit much, but I'm really not that versed with
continous forms so I don't know their quirks.

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top