Display blank record in bound form on load

J

Jason Lindsay

I'm trying to get my bound form to load with an empty
record when the form is first loaded. Using the
recorsetclone and bookmark function do not work, and
initializing the form controls to Null on load blanks out
all data in my record of the bound table.

I want to keep my form bound to the table, but I want the
form to display empty when it is first loaded. I'm
assuming it has something to do with creating a UNION
query for my form's recordsource with Null, but get an SQL
error everytime I try to code the form like that.
 
W

Wayne Morgan

Normally, opening to a "blank" record means opening to a new record. Is that
what you're after?
assuming it has something to do with creating a UNION
query for my form's recordsource with Null

I didn't understand this part, is the RecordSource a Union query? If so,
it's not updateable and you won't be able to get a new record. At what point
do you want records to show in the form?
 
J

John Vinson

I want to keep my form bound to the table, but I want the
form to display empty when it is first loaded.

Two ways to do this:

- Set the Data Entry property of the form to True. This will let you
add new records (but will prohibit viewing old ones).

- Put code in the Form's Load event:

Private Sub Form_Load(Cancel as Integer)
DoCmd.GoToRecord acNewRecord
End Sub
 

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