If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Lock
I need to be able to lock Detailed Description field in a form when
the field contains data. Obviously when creating a new record I need to be able to enter data in the field. I can lock the whole record and I can lock the field at the moment but it then does not allow me to enter data in new records I tried the below codes: Private Sub Detailed_Description_AfterUpdate() Me.Detailed_Description = Now & ", " & Me.Detailed_Description Me.Detailed_Description.Locked = Not IsNull(Me.Detailed_Description) End Sub And I also tried: Private Sub Detailed_Description_AfterUpdate() Dim blnUnlockControl blnUnlockControl = Not Me.NewRecord Me.Detailed_Description.Locked = bnlUnlockControl Me.Detailed_Description = Now & ", " & Me.Detailed_Description Me.Detailed_Description.Locked = Not IsNull(Me.Detailed_Description) End Sub And I tried: Private Sub Detailed_Description_AfterUpdate() If IsNull(Detailed_Description) Then Me.AllowEdits = True Else Me.AllowEdits = False End If Me.Detailed_Description = Now & ", " & Me.Detailed_Description End Sub None of them worked....Can someone tell me please what I'm doing wrong here Thanks, Mark |
#2
|
|||
|
|||
Lock
Put code to unlock the text box in the On Current event of the Form
(this event runs as the form loads or changes a record). Private Sub Form_Current() if isnull(detailed_description) then detailed_description.locked = False end if |
Thread Tools | |
Display Modes | |
|
|