Locking a form control after only 1 update

K

kathy62959

I have a control field in a form called: StartTime
It defaults to #12:00:00 AM#
The user clicks in the field and the current Time is displayed
At this point, before the user exits the form. I need to lock StartTime in
order to disallow any further updates. No one here can seem to figure it out.
 
K

Ken Snell \(MVP\)

I assume that you're using the Click event of the textbox to set the value
to current time? If yes, make the last step of that event procedure the step
that locks the textbox:

Me.NameOfTextBox.Locked = True
 
K

kathy62959

That's what I thought but it is not working
I assume that you're using the Click event of the textbox to set the value
to current time? If yes, make the last step of that event procedure the step
that locks the textbox:

Me.NameOfTextBox.Locked = True
I have a control field in a form called: StartTime
It defaults to #12:00:00 AM#
[quoted text clipped - 3 lines]
order to disallow any further updates. No one here can seem to figure it
out.
 
K

Ken Snell \(MVP\)

Post the code that you're running in the Click event procedure.

--

Ken Snell
<MS ACCESS MVP>

kathy62959 said:
That's what I thought but it is not working
I assume that you're using the Click event of the textbox to set the value
to current time? If yes, make the last step of that event procedure the
step
that locks the textbox:

Me.NameOfTextBox.Locked = True
I have a control field in a form called: StartTime
It defaults to #12:00:00 AM#
[quoted text clipped - 3 lines]
order to disallow any further updates. No one here can seem to figure
it
out.
 
R

Rick A.B.

the event procedure is: On_Click
StartTime = Time
Kathy,

Use this in your On_Click event

If Me.StartTime.Locked = False And Me.StartTime = #12:00:00 AM# Then
Me.StartTime = Time()
Me.StartTime.Locked = True
End If
 
K

kathy62959 via AccessMonster.com

Success! You guys are great. Thanks


Kathy,

Use this in your On_Click event

If Me.StartTime.Locked = False And Me.StartTime = #12:00:00 AM# Then
Me.StartTime = Time()
Me.StartTime.Locked = True
End If
 
Top