default in new record

R

rach

Hi,
I created a form that has some textboxes - not connected, to insert into
them values.
Those values will be the default for the records in this form.
When this form is opened, the new record is null from default.
How can I refresh the new record, to contain the defaults.

Now, After the defaults inserted, I enter to design mode and immediately
back to normal mode, it's work good - the defaults insert to the new record.

I hope you anderstand my problem...
 
A

Al Campagna

rach,
Rather than use unbound text boxes to hold your default values, use the
AfterUpdate event of that field to set the default value to what has just
been entered.
For example, a field named [City], where you just entered "Boston"

Private Sub City_AfterUpdate()
City.DefaultValue = " ' " & City & " ' "
End Sub
(**I put a space between the quote marks for clarity... remove them in
your code).

This will enter "Boston" in every new record you create during that form
session.
If you change the City to "Chicago" at any time, new records thereafter
will have a defualt value of "Chicago"
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

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