after update issue

bigmac

Registered User.
Local time
Today, 11:25
Joined
Oct 5, 2008
Messages
302
can you help please ,
I have a subform with a field [test] this is a date field using the date picker , on the after update control I have the code , me.test.enabled = false .
(I am trying to stop it being updated twice ) , but when I run this it disables all [test] fields , how can I stop this please:confused:
 
Hi. Sounds like you are using a continuous form and [test] is an unbound control. Is this correct? If not, maybe you can post a screenshot of the form to help us picture what you're working with.
 
here we go
 

Attachments

  • test date.JPG
    test date.JPG
    65.5 KB · Views: 92
Okay. Thanks. Just as I thought, it's a continuous form. As such, you won't be able to disable only one or several rows. It's either alll or none because there's really only one control on the form. I think maybe the best approach is to use the control's BeforeUpdate event to cancel any updates if the field already has a date in it.
 
how would I set the before update to cancel any update ?
 
You could try something like:
Code:
 Private Sub TestDate_BeforeUpdate(Cancel As Integer)
    If Me.TestDate<>Me.TestDate.OldValue Then
        Cancel = True
    End If
 End Sub
 
Last edited:
IIRC, you can also disable via Conditional Formatting but you haven't specified under what condition(s) the combo should be disabled.


edit - and yes, I did mean on a continuous form
 

Users who are viewing this thread

Back
Top Bottom