I have a problem thats stumped me for the last week, and if anyone would know what to do it would be you guys
Heres the code I'm working with:
- Code: Select all
Private Sub Timer1_Timer()
On Error GoTo ErrorHandler
Dim orig2 As String
Dim orig3 As Long
Adodc4.RecordSource = "SELECT * FROM tRegister Where cdeRegister='B'"
Adodc4.Refresh
Adodc4.Recordset.Requery
orig2 = Adodc4.Recordset.Fields("cdeLastTransaction")
orig3 = Mid(orig2, 2, Len(orig2) - 2)
If (orig3 <> orig1) Then
Adodc1.RecordSource = "SELECT * FROM tSaleTransactions Where cdeTrans='B" & orig3 & "'"
Adodc1.Refresh
If (Adodc1.Recordset.RecordCount = 0) Then
Do Until Adodc1.Recordset.RecordCount = 1
Adodc1.RecordSource = "SELECT * FROM tSaleTransactions Where cdeTrans='B" & orig3 & "'"
Adodc1.Refresh
Loop
End If
If (Adodc1.Recordset.RecordCount <> 0) Then
If (Adodc1.Recordset.Fields("cdeCustCode") <> Empty) Then
If Adodc1.Recordset.Fields("cdeCustCode") >= 100000000 Then
Adodc2.RecordSource = "SELECT * FROM acc Where AccountNumber='" & Adodc1.Recordset.Fields("cdeCustCode") & "'"
Adodc2.Refresh
Call Command1_Click
Call Command2_Click
End If
End If
End If
End If
Adodc4.RecordSource = "SELECT * FROM tRegister Where cdeRegister='B'"
Adodc4.Refresh
Adodc4.Recordset.Requery
orig = Adodc4.Recordset.Fields("cdeLastTransaction")
orig1 = Mid(orig, 2, Len(orig) - 2)
Exit Sub
ErrorHandler:
Call Timer1_timer
End Sub
This works fine, except the program pops up with the "the database has been placed in a state..." error, but once you click ok the program starts the loop over and everything is fine.
How do I get the error to not show up??
Thanks


