Date =Now() - Update in edit mode

whhaatt

Registered User.
Local time
Today, 11:02
Joined
Aug 10, 2005
Messages
42
Please can someone help

I am using switchboards, and i open the form in edit mode.

Is there anyway to show the present Date in the text box.

The task is to save the Date in the field (so that it shows in the relevant table)

In other words once Todays date is showing in the form then when i save and exit the form the date will also show in the table.


Please help
 
In the properties of your text box, put the following in Default Value
=Date()
That will give you the date. If you want the date and time then put in the following
=Now()

Make sure your text box is bound to a table and it will automatically save once you update the record.

Gregg
 
I think you want to update the date everytime the row is changed, if so set the fields to Date() in the forms after update event
 
Are you talking about entering a new record and having the date saved to a field?

In Design View, right click the textbox control, goto Properties - Data and set Default Value as = Date() You must include the ().

Or are you talking about making changes to a record and having the date the changes were made saved to the field? Something like


Code:
Private Sub Form_Dirty(Cancel As Integer)
  YourDateField = Date()
End Sub

Good Luck!
 
the field is called Datepresent (Is in format Date in Table edit mode)

the form is opened so that a record can be amended.

I need this field to be filled in automatically with the present date

once this is done when i save and close the record, i need the new date to save details in the table under the field Datepresent.

I have tried the above but no joy
 
The code I posted above should do this! Did you try it?

Code:
Private Sub Form_Dirty(Cancel As Integer)
  Datepresent = Date()
End Sub
 
Thanks for that, that does work, however this is not saved when i exit the form, whereas everything else is

(Datepresent field on table is blank)
 
See the problem? I'm fairly sure he's updating the textbox on his form, but not the field on his table. The textbox needs to be linked to the field (the ControlSource on the form needs to equal the field name on the table). Otherwise, the value will never be saved.
 
I have put the following in

Code:
Private Sub Form_Issue_KFI(Cancel As Integer)
  Datepresent = Date
End Sub
the brackets after date auto delete when i put them in

I have now set the control source right, however the value now shows as #name when i run the form
 

Users who are viewing this thread

Back
Top Bottom