Command button click event

S

sasec

Pardon the following "slop", but I'm new at this. I have a database
whose main table has 8 of 11 fields filled in by a report. I am
attempting to update the remaining 3 fields (start time, finish time,
and balanced) based on the input from a form. For the start and finish
times, I have created command buttons for the following purposes. For
the start time command button, I only want it "clickable" if the start
time field is empty. Once clicked, I would like a message box to
prompt the user to verify they are ready to start, then, if they click
"OK" to record that time in the start time field, disable the start
command button, and update the form. I have made the following attempt
at a private sub:

Private Sub Start_Click()
Dim intResponse As Integer
intResponse = MsgBox(Prompt:="The start time can NOT be changed. Only
click OK if you are ready to balance!" _
, Buttons:=vbOKCancel + vbExclamation + vbDefaultButton2,
Title:="WARNING")
If intResponse = vbOK Then
Me![Start_Time] = Time()
Me.Finish.SetFocus
Me.Start.Enabled = False
Else
End If
End Sub

It works, but it disables all of the start times in the form instead of
just the one clicked. (The form contains any number of records). I'm
attempting to handle the refresh from a private OnUpdate sub in the
Start Time field.

I haven't attempted the Finsh command button yet, but would like a
message of "Is the tracer in balance?" to update the check box and, if
the answer is yes, to update the form without that record showing.

Any and all comments and suggestions are greatly appreciated. If more
information is needed, please just let me know.

Thank you,

A
 

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