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 / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

New Record question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ayo - 17 Jan 2008 02:03 GMT
DoCmd.Close acForm, "Invoice Database Launch", acSaveYes
   DoCmd.OpenForm "Invoice Tracker New Entry", acNormal
   Application.Forms("Invoice Tracker New Entry").Caption = "CREATE INVOICE"
   DoCmd.GoToRecord , , acNewRec

When I use the above code. It creates a blank record in the datasheet. Is
there a way to delete the record if it is blank and keep the record if there
are data in it?
Arvin Meyer [MVP] - 17 Jan 2008 03:18 GMT
There is always a new, empty record at the end of a datasheet unless you
have set AllowNewRecords to False, or your query is not updateable.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> DoCmd.Close acForm, "Invoice Database Launch", acSaveYes
>    DoCmd.OpenForm "Invoice Tracker New Entry", acNormal
[quoted text clipped - 6 lines]
> there
> are data in it?
Ayo - 17 Jan 2008 03:47 GMT
Thanks Arvin.
So, how would I delete empty records from the database using code when the
form closes. I would like to delete any blank records that are created in the
datasheet when the form used to add records to the datasheet is closed.

> There is always a new, empty record at the end of a datasheet unless you
> have set AllowNewRecords to False, or your query is not updateable.
[quoted text clipped - 8 lines]
> > there
> > are data in it?
Arvin Meyer [MVP] - 17 Jan 2008 04:28 GMT
The empty record I am talking about is a placeholder, not a real record.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> Thanks Arvin.
> So, how would I delete empty records from the database using code when the
[quoted text clipped - 15 lines]
>> > there
>> > are data in it?
Ayo - 17 Jan 2008 04:57 GMT
Thanks Arvin. I found another post on here that kinda show me how to do what
I needed to do, using DoCmd.RunCommand.

> The empty record I am talking about is a placeholder, not a real record.
> > Thanks Arvin.
[quoted text clipped - 16 lines]
> >> > there
> >> > are data in it?
 
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



©2009 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.