locked combobox on form when record in table = n or x (1 Viewer)

murray83

Games Collector
Local time
Today, 03:06
Joined
Mar 31, 2017
Messages
729
Good Morning, :cool:

this is my code

Code:
'lock selection box
Private Sub Status_AfterUpdate()
If Me.Status.Value = Me.txtStatusDone.Value Or Me.Status.Value = Me.txtStatusRefused.Value Then
Me.cmbActionedBy.Locked = True
Else
Me.cmbActionedBy.Locked = False
End If

my aim is to lock the said cmbActionedBy so when a record is either done or refused it cant be altered

i have tried it in form load and also in the afterupdate part of the status as above but so far to no avail

any ideas what I am obviously doing wrong :banghead:

cheers all :D

attach is a screen shot of the table and form in question
 

Attachments

  • ex1.png
    ex1.png
    94.3 KB · Views: 31

CJ_London

Super Moderator
Staff member
Local time
Today, 03:06
Joined
Feb 19, 2013
Messages
16,612
have your tried

Me.cmbActionedBy.Locked = Me.Status= Me.txtStatusDone Or Me.Status= Me.txtStatusRefused

in the form current event?

Note you do not need the .value
 

murray83

Games Collector
Local time
Today, 03:06
Joined
Mar 31, 2017
Messages
729
shall give it a go and let you know
 

murray83

Games Collector
Local time
Today, 03:06
Joined
Mar 31, 2017
Messages
729
CJ_London

works like a charm, job done, problem solved

thank you
 

Users who are viewing this thread

Top Bottom