With the code below I'm trying to clean up nulls on close (via cmd button),
its propting for a parameter:
"Forms!frmPtDemographicNew!frmVisitNewEdit!fsubRNnotes.Form!fldRNnotes."
DoCmd.RunSQL "DELETE * FROM tblRNnotes WHERE [fldRNnotes] = [Forms]!
[frmPtDemographicNew]![frmVisitNewEdit]![fsubRNnotes].Form![fldRNnotes] Is
Null"
DoCmd.Close
I'm not sure what its asking for. Thanks for your help in advance, Rob
Rick Brandt - 11 Jun 2007 01:38 GMT
> With the code below I'm trying to clean up nulls on close (via cmd
> button), its propting for a parameter:
[quoted text clipped - 7 lines]
>
> I'm not sure what its asking for. Thanks for your help in advance, Rob
Your SQL is (in effect) saying "Delete records in this table where this value on
a form is Null". I would be surprised if that is what you actually want. You
probably want to delete records in the table where fields in the table are null
(right?).
Beyond that, the parameter prompt is (I think) caused by the fact that the Close
event is too late to use a control in the form as a reference. The UnLoad event
might be a better choice.

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
John W. Vinson - 11 Jun 2007 01:43 GMT
>With the code below I'm trying to clean up nulls on close (via cmd button),
>its propting for a parameter:
>
> "Forms!frmPtDemographicNew!frmVisitNewEdit!fsubRNnotes.Form!fldRNnotes."
Just what are you attempting to do???
A Query can't search a Form. It searches a table. It looks like you're trying
to find a Subform which is NULL - which isn't going to work!
And you have two forms mentioned in the above forms reference. Which is your
mainform - frmPtDemographicNew or frmVisitNewEdit? It can't be both.
John W. Vinson [MVP]