Private Sub Form_Current()
If Not Me.NewRecord
Then
Me.Id.Locked = False
Me.Id.Enabled = True
Me.ContractNumber.Locked = True
Me.ContractNumber.Enabled = False
Else Me.Id.Locked = False
Me.Id.Enabled = True
Me.ContractNumber.Locked = False
Me.ContractNumber.Enabled = True
End If
End Sub
strSQL = "UPDATE TableName SET TableName.TableFieldName= 'NewValue' WHERE (((TableName.TableFieldName) Is Null Or (TableName.TableFieldName)=''));"
DoCmd.RunSQL strSQL
strSQLDayReportDelete = "DELETE TableName.* " & _
"FROM TableName" & _
"WHERE (((format(TableName.FieldName,'YYYY-MM-DD'))=#" & Date & "#));"
strSQLHistoryE = "INSERT INTO TableName1( FieldName1, FieldName2, FieldData, FieldUserName)" & _
"SELECT TableName2.FiledName1, TableName2.FiledName1, #" & Now() & "#, '" & UserName & "' " & _
"FROM TableName2;"