var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: store default value
I have a form with a field called date. Just after I am adding a new record to my database by pressing one of the form's buttons the field date returns to it's default value. I would like it to store the value I have just typed in the field as it's default value for new records.
Anybody could help me?
Let me make sure I understand:
You want to dynamically update the default value of your date field to the date value you entered on the last record.
This is one way to do that...
Option Compare Database
Private Sub Form_Open(Cancel As Integer)
var_date = DLookup("date", "q1", "ID = (SELECT MAX(ID) FROM q1)")
txt_date.DefaultValue = "#" & var_date & "#"
Private Sub txt_date_AfterUpdate()
txt_date.DefaultValue = "#" & txt_date & "#"
I included the open form event to look for the date of the most recently entered record.
A sample A2K database is attachted to this message.
hope this helps
Last edited by santiago_jon; 07-16-04 at