How to update a field in a record

  • Thread starter time_racer via AccessMonster.com
  • Start date
T

time_racer via AccessMonster.com

I have a form with a text box and one button, that if the user clicks on it,
it would automatically update the table with the date and time of clicking
and move to a new record

So how to do that? or what is the code to update the tasktime field in that
record?
 
A

Allen Browne

Private Sub cmdUpdate_Click
If Not Me.NewRecord Then
Me.tasktime = Now()
Me.Dirty = False
RunCommand acCmdRecordsGotoNew
End If
End Sub
 
T

time_racer via AccessMonster.com

Allen said:
Private Sub cmdUpdate_Click
If Not Me.NewRecord Then
Me.tasktime = Now()
Me.Dirty = False
RunCommand acCmdRecordsGotoNew
End If
End Sub
I have a form with a text box and one button, that if the user clicks on
it,
[quoted text clipped - 4 lines]
that
record?


Hi Allen

Thanks for your reply
But I have one problem with that, The tasktime is not bound to any control or
part of the form it is only exist in the table. In the form I have just one
text box which is bounded to reference# of the task and I have a click button
which should move me to new record and record the timing in the tasktime in
that table.
 
B

Bob Quintal

Allen said:
Private Sub cmdUpdate_Click
If Not Me.NewRecord Then
Me.tasktime = Now()
Me.Dirty = False
RunCommand acCmdRecordsGotoNew
End If
End Sub
I have a form with a text box and one button, that if the user
clicks on it,
[quoted text clipped - 4 lines]
that
record?


Hi Allen

Thanks for your reply
But I have one problem with that, The tasktime is not bound to any
control or part of the form it is only exist in the table. In the
form I have just one text box which is bounded to reference# of
the task and I have a click button which should move me to new
record and record the timing in the tasktime in that table.
Make sure that tasktime is part of the form's recordset.If you used
the table it will be, if you used a query it may not, so add it.

Put a textbox on the form bound to tasktime. delete the label, make
the textbox tiny, and set its visible property to false.

Save and use.
 

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