can't assign value to this object

G

Guest

I have a data entry form. I want to assign a date to the Day field in a table
when user goes to the next row thru hidden txtDate text box.
But, I'm getting the error: Run-Time error -21437352567 (80020009) You can't
assign a value to this object

For all other objects (except the date one) I'm using the before update
event as I need to assign values there if something is entered into the Form
and everything is working well.

Here is the code for the Date (Day field):
On Load:
Me.txtDate.ControlSource = "Day" ' the table field

OnCurrent:
Dim dtDate As Date
dtDate = Forms!frmInterview!txtSelectDate
Me.txtDate.Requery
Me.txtDate = dtDate ' here is the error

Please, advise what's wrong there.
Thanks
 
G

Guest

The day is a reserved name in access, so either change the name of the field
or try this

Me.txtDate.ControlSource = "[Day]"
 

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