Need all records on continuous form to meet a criteria

G

Guest

I have a continuous form that populates based on a user selecting items on
another form's multi-select list box. They then fill in additional fields on
the continous form for the records they selected in the list box on the prior
form. I thought writing a formula that upon click of the "Save & Close this
form" button, IF there was a null value in txtComments, then msgbox "Please
enter a comment in one or more records on this continuous form." would work.
But the IF ISNULL statement only investigates the current record on the
continous form. IF(IS NULL(txtComments)...

How do I get it to determine if ANY of the comment text boxes on the
continuous form (other than the "Add New Record") are null?
 
G

Guest

You could loop through the form's RecordsetClone and check each comment field.

Steve
 
J

John W. Vinson

How do I get it to determine if ANY of the comment text boxes on the
continuous form (other than the "Add New Record") are null?

The records aren't on the form.

They're *IN THE TABLE* that the form is bound to.

One problem with a continuous form is that the mainform record is (must be, to
maintain referential integrity) saved at the moment that you setfocus to the
subform; each subform record is saved at the time you move to a new subform
record. There isn't any event that fires when "all of the records" are
complete - in a sense there can't be such an event, since the user could visit
the records in any order, and unless Allow Additions is turned off, add new
records at will!

You may need a "accept" button which checks, e.g.

DCount("*", "[tablename]", "<some criteria> AND [Comments] IS NULL")

where the <some criteria> filters the records to those displayed in the
subform. If this count is non-zero you still have unfilled comments.

John W. Vinson [MVP]
 

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