New Record question

A

Ayo

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?
 
A

Arvin Meyer [MVP]

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.
 
A

Ayo

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.
 
A

Ayo

Thanks Arvin. I found another post on here that kinda show me how to do what
I needed to do, using DoCmd.RunCommand.
 

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