Hi All,
I am relatively new to Access. I am wondering if someone can help me to overcome a problem that I have encountered in a database that I have inherited at work. I have a mask whose fields are locked and activated by a button. The code is
Private Sub Interruttore28_Click()
If Forms("Elenco DIA").Controls("Num").Locked = True Then
Forms("Elenco DIA").Controls("Num").Locked = False
Forms("Elenco DIA").Controls("Prot").Locked = False
Forms("Elenco DIA").Controls("Data").Locked = False
Forms("Elenco DIA").Controls("Indirizzo").Locked = False
Forms("Elenco DIA").Controls("Titolare Denuncia").Locked = False
Forms("Elenco DIA").Controls("Interruttore28").Caption = "Blocca Inserimento"
Else
Forms("Elenco DIA").Controls("Num").Locked = True
Forms("Elenco DIA").Controls("Prot").Locked = True
Forms("Elenco DIA").Controls("Data").Locked = True
Forms("Elenco DIA").Controls("Indirizzo").Locked = True
Forms("Elenco DIA").Controls("Titolare Denuncia").Locked = True
Forms("Elenco DIA").Controls("Interruttore28").Caption = "Sblocca Inserimento"
End If
End Sub
The code works fine.
Then I had to add two memo field (Descrizione, Note) to the underlining table. I then modified the mask and I changed the code like this:
Private Sub Interruttore28_Click()
If Forms("Elenco DIA").Controls("Num").Locked = True Then
Forms("Elenco DIA").Controls("Num").Locked = False
Forms("Elenco DIA").Controls("Prot").Locked = False
Forms("Elenco DIA").Controls("Data").Locked = False
Forms("Elenco DIA").Controls("Descrizione").Disabled = False
Forms("Elenco DIA").Controls("Note").Disabled = False
Forms("Elenco DIA").Controls("Indirizzo").Locked = False
Forms("Elenco DIA").Controls("Titolare Denuncia").Locked = False
Forms("Elenco DIA").Controls("Interruttore28").Caption = "Blocca Inserimento"
Else
Forms("Elenco DIA").Controls("Num").Locked = True
Forms("Elenco DIA").Controls("Prot").Locked = True
Forms("Elenco DIA").Controls("Data").Locked = True
Forms("Elenco DIA").Controls("Descrizione").Disabled = True
Forms("Elenco DIA").Controls("Note").Disabled = True
Forms("Elenco DIA").Controls("Indirizzo").Locked = True
Forms("Elenco DIA").Controls("Titolare Denuncia").Locked = True
Forms("Elenco DIA").Controls("Interruttore28").Caption = "Sblocca Inserimento"
End If
End Sub
But, now, when I press the button the system gives me the following error:
Runtime Error "438"
Property or method not supported by the object.
I would really apreciate I someone can suggest to me how can I avoid this problem and get the code right!
Thanks
Oringate