Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / June 2007

Tip: Looking for answers? Try searching our database.

Trying to clean up null on close

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RobUCSD - 11 Jun 2007 01:25 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."

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]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.