Locking a form control after only 1 update

  • Thread starter Thread starter kathy62959
  • Start date Start date
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.
 
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
 
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.
 
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.
 
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
 
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
 
Back
Top