Geordie2008
Registered User.
- Local time
- Today, 01:10
- Joined
- Mar 25, 2008
- Messages
- 177
Afternoon All,
i have the following code (highlighted below in Blue) within my "Form" properties. The aim of the code is as follows:
I would like to open the form and populate it with the values as they appear currently in the form.
E.g.
Mandy Smith, Employee, (Record_Date: 01/01/2008)
when the user closes the form I want to change the Record_Date value to =now()
so that when I next open the form I get:
Mandy Smith, Employee, (Record_Date: 01/04/2008)
So when the form closes I want to populate the Record_Date value with =now() and until that point I want it populated with whatever was last populated in the "Record_Date" field of the table.
Private Sub Form_Close()
Me.Hid_DAT = txtNow
End Sub
txt.now is an unbound text box with the following default value "=Now()" and I set Hid_DAT to equal this when it closes. Hid_DAT is bound to the Record_Date field within the table... (so I expected it to populate this field...
This doesn't work and bombs out on:
Me.Hid_DAT = txtNow
I assume I have the syntax wrong as when I hover over it, it says:
Me.Hid_DAT = txtNow = False
What syntax do I require in order to make it update the field "Me.Hid_DAT" with the data in the field "txt.Now"?
Many thanks,
Mandy
i have the following code (highlighted below in Blue) within my "Form" properties. The aim of the code is as follows:
I would like to open the form and populate it with the values as they appear currently in the form.
E.g.
Mandy Smith, Employee, (Record_Date: 01/01/2008)
when the user closes the form I want to change the Record_Date value to =now()
so that when I next open the form I get:
Mandy Smith, Employee, (Record_Date: 01/04/2008)
So when the form closes I want to populate the Record_Date value with =now() and until that point I want it populated with whatever was last populated in the "Record_Date" field of the table.
Private Sub Form_Close()
Me.Hid_DAT = txtNow
End Sub
txt.now is an unbound text box with the following default value "=Now()" and I set Hid_DAT to equal this when it closes. Hid_DAT is bound to the Record_Date field within the table... (so I expected it to populate this field...
This doesn't work and bombs out on:
Me.Hid_DAT = txtNow
I assume I have the syntax wrong as when I hover over it, it says:
Me.Hid_DAT = txtNow = False
What syntax do I require in order to make it update the field "Me.Hid_DAT" with the data in the field "txt.Now"?
Many thanks,
Mandy