VBA Site contains VBA code to create macros in WORD EXCEL ACCESS OUTLOOK

lock and enable records

 

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

 

Update

 

strSQL = "UPDATE TableName SET TableName.TableFieldName= 'NewValue' WHERE (((TableName.TableFieldName) Is Null Or (TableName.TableFieldName)=''));"

DoCmd.RunSQL strSQL

 

Delete

strSQLDayReportDelete = "DELETE TableName.* " & _

"FROM TableName" & _

"WHERE (((format(TableName.FieldName,'YYYY-MM-DD'))=#" & Date & "#));"

 

Insert

strSQLHistoryE = "INSERT INTO TableName1( FieldName1, FieldName2, FieldData, FieldUserName)" & _

"SELECT TableName2.FiledName1, TableName2.FiledName1, #" & Now() & "#, '" & UserName & "' " & _

"FROM TableName2;"



Dodaj komentarz






Dodaj

© 2013-2024 PRV.pl
Strona została stworzona kreatorem stron w serwisie PRV.pl