report within form

  • Thread starter Thread starter OBWAN
  • Start date Start date
O

OBWAN

I have a mainform with visible subforms linking to child
tables. Main table and child table relate by AutoID.

When the user DoCmd.close acForm by clicking on a
commandbutton, The user wants to see a "report" of sorts
pop up (become visible) that lists any critical fields on
either the mainform or the subform(s) that are still Null.

I can kind of see that .tag can help identify
the "critical fields", and a subform can contain
this "report" and be made .visible = yes when the user
clicks the command button. But I get stuck there on
whether to use a query, a report, how to call it in the
subform.visible -yes window.
 
AFAIK, you cannot display a Report in a Subform control, nor a Subreport
control on a Form -- although you can display a Form in a Subreport control.
No, I haven't figured out the design distinction.

So, you can rule out "Report" as an option. Have you considered just
constructing the message for a MsgBox in the BeforeUpdate event, listing the
fields that are in error, then setting Cancel = True prior to exiting, so
control will return to the Form?

If you have other Subforms on the Form, the Form will be saved when you move
Focus from the main Form to a Subform Control -- this might be a
complication! Of course, that may be why you want to have this check, rather
than just make the fields "Required".

Larry Linson
Microsoft Access MVP
 
Have you considered just constructing the message for a
MsgBox in the BeforeUpdate event, listing the fields that
are in error, then setting Cancel = True prior to exiting,
so >control will return to the Form?


good idea

so how do I get the fields to become listed in the msgbox?

for each fieldOfNoSequentialNameConvention
IF ISNULL(field1) then
include it on the msgbox

next fieldOfNoSequentialNameConvention

print msgbox
 
Back
Top