G
Guest
I am using MS Access 2003. My application has a form with a command button
on it that will "lock" a record from further updating--turns a bit variable
on. Below are the command button basics:
Private Sub cmdLockCustomer_Click()
On Error GoTo Err_Handler
Dim strCustCode As String
strCustCode = Me.txtCustomerCode
Call LockCustomer(strCustCode)
Exit_Here:
Exit Sub
Err_Handler:
LogErrorToTable Err.Number, Err.Description, "Form_CustomerInfo",
"LockCustomer", Erl
Resume Exit_Here
End Sub
Public Function LockCustomer(CustCode As String)
On Error GoTo Err_Handler
Dim strSQL As String
Dim dbs As DAO.Database
Set dbs = CurrentDb
strSQL = "UPDATE CustomerInfo SET [Locked] = True WHERE
([CustomerCode]='" & CustCode & "');"
dbs.Execute strSQL, dbSeeChanges + dbFailOnError
Exit_Here:
Set dbs = Nothing
Exit Function
Err_Handler:
LogErrorToTable Err.Number, Err.Description, "CustomerServices",
"LockCustomer", Erl
Resume Exit_Here
End Function
When the dbs.execute statement runs it crashes access and totally blows me
out. Anyone know why this might happen?
Here is the Access error msg:
AppName: msaccess.exe AppVer: 11.0.6566.0 AppStamp:42cdb33e
ModName: ntdll.dll ModVer: 5.1.2600.2180 ModStamp:411096b4
fDebug: 0 Offset: 00001010
Thanks for your help!!
on it that will "lock" a record from further updating--turns a bit variable
on. Below are the command button basics:
Private Sub cmdLockCustomer_Click()
On Error GoTo Err_Handler
Dim strCustCode As String
strCustCode = Me.txtCustomerCode
Call LockCustomer(strCustCode)
Exit_Here:
Exit Sub
Err_Handler:
LogErrorToTable Err.Number, Err.Description, "Form_CustomerInfo",
"LockCustomer", Erl
Resume Exit_Here
End Sub
Public Function LockCustomer(CustCode As String)
On Error GoTo Err_Handler
Dim strSQL As String
Dim dbs As DAO.Database
Set dbs = CurrentDb
strSQL = "UPDATE CustomerInfo SET [Locked] = True WHERE
([CustomerCode]='" & CustCode & "');"
dbs.Execute strSQL, dbSeeChanges + dbFailOnError
Exit_Here:
Set dbs = Nothing
Exit Function
Err_Handler:
LogErrorToTable Err.Number, Err.Description, "CustomerServices",
"LockCustomer", Erl
Resume Exit_Here
End Function
When the dbs.execute statement runs it crashes access and totally blows me
out. Anyone know why this might happen?
Here is the Access error msg:
AppName: msaccess.exe AppVer: 11.0.6566.0 AppStamp:42cdb33e
ModName: ntdll.dll ModVer: 5.1.2600.2180 ModStamp:411096b4
fDebug: 0 Offset: 00001010
Thanks for your help!!