A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

default in new record



 
 
Thread Tools Display Modes
  #1  
Old September 10th, 2008, 07:59 AM posted to microsoft.public.access
Rach
external usenet poster
 
Posts: 17
Default default in new record

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

  #2  
Old September 10th, 2008, 01:56 PM posted to microsoft.public.access
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default default in new record

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

"rach" wrote in message
news
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...



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.