Hello everyone,
I have some problem with my form. I set property in main form at non editable but I want set allowedits in VBA code when form open only for specify column.
My code with set focus for specify column and enable editing for all form is below but i want enable editing only for one column "M12"
Thanks
DT
I have some problem with my form. I set property in main form at non editable but I want set allowedits in VBA code when form open only for specify column.
My code with set focus for specify column and enable editing for all form is below but i want enable editing only for one column "M12"
Code:
Private Sub Form_Open(Cancel As Integer)
Dim strPeriod As String
Dim strColname As String
' in this example Me.mPeriod = 201312
strPeriod = Right(Me.mPeriod, 2) 'result 12
strColname = "M" & strPeriod ' result M12
' column in forms name like M01, M02, M03,...., M12
Me.Controls(strColname).SetFocus
Select Case strColname
Case "M12"
Me.AllowEdits = True
End Select
End Sub
DT
Last edited: