Hi all,
I have almost finished a database which is now in its final testing phase. The database is split with the be in a network location and it is being tested on and off by about 6 people. I have been working on different versions so the testing has been going on now for about 2 months and is nearing completion.
I have however, one nagging issue that shows up once or twice every couple of days and then dissapears. This is a 3049 Error (corruption issue).
This issue has happened to all users at one point or another and it happens when a control on a specific form is clicked on. The form is "frmsearch" and it is the one that stays open pretty much all the time. This error comes after clicking on any one of the buttons on this form (there are 6 buttons on it) or double-clicking on a list, so it does not seem to be caused by one specific control. Further, the same user can click on the same button that gave him trouble five minutes later and it all works fine. Another user can be logged on clicking on the same control at the same time without issues either.
I am confused. At first I thought that a specific control might be corrupted, then I thought it was the form,...now I think that this may have something to do with possible network issues.
This is the code behind the form
How can I know what is causing this and what is the fix?
mafhobb
I have almost finished a database which is now in its final testing phase. The database is split with the be in a network location and it is being tested on and off by about 6 people. I have been working on different versions so the testing has been going on now for about 2 months and is nearing completion.
I have however, one nagging issue that shows up once or twice every couple of days and then dissapears. This is a 3049 Error (corruption issue).
This issue has happened to all users at one point or another and it happens when a control on a specific form is clicked on. The form is "frmsearch" and it is the one that stays open pretty much all the time. This error comes after clicking on any one of the buttons on this form (there are 6 buttons on it) or double-clicking on a list, so it does not seem to be caused by one specific control. Further, the same user can click on the same button that gave him trouble five minutes later and it all works fine. Another user can be logged on clicking on the same control at the same time without issues either.
I am confused. At first I thought that a specific control might be corrupted, then I thought it was the form,...now I think that this may have something to do with possible network issues.
This is the code behind the form
Code:
Option Compare Database
Private Sub cmdPM_Click()
Dim stDocName As String
Dim stLinkCriteria As String
' The following is the variable definition for the error handler
On Error GoTo cmdPM_Click_Error
Dim ErrorForm As String
Dim ErrorControl As String
Dim ErrorCode As String
Dim ErrorNumber As String
ErrorForm = Nz(Screen.ActiveForm.Name, "No Form Loaded")
ErrorControl = Nz(Screen.ActiveControl.Name, "No Control Loaded")
' Procedure
stDocName = "frmPMOptions"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub
' Error handler
cmdPM_Click_Error:
ErrorNumber = Err.Number
ErrorCode = Err.Description
Call SendError(ErrorCode, ErrorNumber, ErrorControl, ErrorForm)
Exit Sub
End Sub
Private Sub cmdRD_Click()
Dim stDocName As String
Dim stLinkCriteria As String
' The following is the variable definition for the error handler
On Error GoTo cmdRD_Click_Error
Dim ErrorForm As String
Dim ErrorControl As String
Dim ErrorCode As String
Dim ErrorNumber As String
ErrorForm = Nz(Screen.ActiveForm.Name, "No Form Loaded")
ErrorControl = Nz(Screen.ActiveControl.Name, "No Control Loaded")
' Procedure
stDocName = "frmRDOptions"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub
' Error handler
cmdRD_Click_Error:
ErrorNumber = Err.Number
ErrorCode = Err.Description
Call SendError(ErrorCode, ErrorNumber, ErrorControl, ErrorForm)
Exit Sub
End Sub
Private Sub cmdSearch_Click()
' The following is the variable definition for the error handler
On Error GoTo cmdsearch_Click_Error
Dim ErrorForm As String
Dim ErrorControl As String
Dim ErrorCode As String
Dim ErrorNumber As String
ErrorForm = Nz(Screen.ActiveForm.Name, "No Form Loaded")
ErrorControl = Nz(Screen.ActiveControl.Name, "No Control Loaded")
Me.txtsearch.SetFocus
'Check the value of chkIssueNumberSearch
If chkIssueNumberSearch = -1 Then
' please note that the first part of the search (for txtsearch or box 1 in the form) is done directly in the query SearchCallIDtxt
'Enter the query for Searching by CallID
Me.lstsearch.RowSource = "Select [ContactID], [CustomerID],[FirstName], [LastName], [PostalCode], [CompanyName], Format([WorkPhone],'(###) ###-####'), Format([HomePhone],'(###) ###-####'),Format([MobilePhone],'(###) ###-####'),[EmailName],[CallID]" & _
"From [SearchCallIDtxt]" & _
"Where [CallID] like '*" & Me.txtsearch2 & "*'" & _
"Order By Not IsNull([lastName]), [LastName], [FirstName];"
Me.lstsearch.Requery
Else
'Enter the query for searching by All the other fields
' please note that the first part of the search (for txtsearch or box 1 in the form) is done directly in the query SearchCustomertxt
Me.lstsearch.RowSource = "Select [ContactID], [CustomerID],[FirstName], [LastName], [PostalCode], [CompanyName], Format([WorkPhone],'(###) ###-####'), Format([HomePhone],'(###) ###-####'),Format([MobilePhone],'(###) ###-####'),[EmailName]" & _
"From [SearchCustomertxt]" & _
"Where [CustomerID] like '*" & Me.txtsearch2 & "*'" & _
"OR [FirstName] like '*" & Me.txtsearch2 & "*'" & _
"OR [LastName] like '*" & Me.txtsearch2 & "*'" & _
"OR [PostalCode] like '*" & Me.txtsearch2 & "*'" & _
"OR [CompanyName] like '*" & Me.txtsearch2 & "*'" & _
"OR [WorkPhone] like '*" & Me.txtsearch2 & "*'" & _
"OR [HomePhone] like '*" & Me.txtsearch2 & "*'" & _
"OR [MobilePhone] like '*" & Me.txtsearch2 & "*'" & _
"OR [EmailName] like '*" & Me.txtsearch2 & "*'" & _
"Order By Not IsNull([lastName]), [LastName], [FirstName];"
Me.lstsearch.Requery
End If
Me.txtcount = Me.lstsearch.ListCount
Exit Sub
cmdsearch_Click_Error:
ErrorNumber = Err.Number
ErrorCode = Err.Description
Call SendError(ErrorCode, ErrorNumber, ErrorControl, ErrorForm)
Exit Sub
End Sub
Private Sub cmdTechOpt_Click()
Dim stDocName As String
Dim stLinkCriteria As String
' The following is the variable definition for the error handler
On Error GoTo cmdTechOpt_Click_Error
Dim ErrorForm As String
Dim ErrorControl As String
Dim ErrorCode As String
Dim ErrorNumber As String
ErrorForm = Nz(Screen.ActiveForm.Name, "No Form Loaded")
ErrorControl = Nz(Screen.ActiveControl.Name, "No Control Loaded")
' Procedure
stDocName = "Tech Options"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub
' Error handler
cmdTechOpt_Click_Error:
ErrorNumber = Err.Number
ErrorCode = Err.Description
Call SendError(ErrorCode, ErrorNumber, ErrorControl, ErrorForm)
Exit Sub
End Sub
Private Sub Form_Activate()
On Error GoTo Form_Activate_Error
DoCmd.Maximize
Exit Sub
Form_Activate_Error:
Dim ErrorForm As String
Dim ErrorControl As String
Dim ErrorCode As String
Dim ErrorNumber As String
ErrorForm = Nz(Screen.ActiveForm.Name, "No Form Loaded")
ErrorControl = Nz(Screen.ActiveControl.Name, "No Control Loaded")
ErrorNumber = Err.Number
ErrorCode = Err.Description
Call SendError(ErrorCode, ErrorNumber, ErrorControl, ErrorForm)
Exit Sub
End Sub
Private Sub Form_GotFocus()
On Error GoTo Form_GotFocus_Error
DoCmd.Maximize
Exit Sub
Form_GotFocus_Error:
Dim ErrorForm As String
Dim ErrorControl As String
Dim ErrorCode As String
Dim ErrorNumber As String
ErrorForm = Nz(Screen.ActiveForm.Name, "No Form Loaded")
ErrorControl = Nz(Screen.ActiveControl.Name, "No Control Loaded")
ErrorNumber = Err.Number
ErrorCode = Err.Description
Call SendError(ErrorCode, ErrorNumber, ErrorControl, ErrorForm)
Exit Sub
End Sub
Private Sub Form_Load()
Dim Level As String
On Error GoTo Form_Load_Error
DoCmd.Maximize
'Check what is the security level of the user
Level = Nz(DLookup("FldAccesslevel", "Tbl-Permissions", "FKuserID = " & StrLoginName & ""), "")
' MsgBox Level
'Note: By default, cmdadmin button is hidden and cmdtechoptions is visible
'if the user is a "1"; a "Manager" then make the admin button vissible
If Level = 1 Then
cmdadmin.Visible = True
End If
'if the user is a "2" then hide PM options, tech Options
If Level = 2 Then
cmdRD.Visible = False
cmdPM.Visible = False
End If
'if the user is a "3" then hide cmdtechoptions and cmdPM
If Level = 3 Then
cmdPM.Visible = False
cmdTechOpt.Visible = False
End If
'if the user is a "4" then hide cmdtechoptions and cmdRD
If Level = 4 Then
cmdTechOpt.Visible = False
cmdRD.Visible = flase
End If
'if the user is a "5" then you have no access. Quit db
If Level = 5 Then
MsgBox "Sie benötigen einen höheren Zugangsstatus um fortzufahren"
DoCmd.Close
End If
Exit Sub
Form_Load_Error:
Dim ErrorForm As String
Dim ErrorControl As String
Dim ErrorCode As String
Dim ErrorNumber As String
ErrorForm = Nz(Screen.ActiveForm.Name, "No Form Loaded")
ErrorControl = Nz(Screen.ActiveControl.Name, "No Control Loaded")
ErrorNumber = Err.Number
ErrorCode = Err.Description
Call SendError(ErrorCode, ErrorNumber, ErrorControl, ErrorForm)
Exit Sub
End Sub
Private Sub lstsearch_DblClick(Cancel As Integer)
If IsNull(Me.lstsearch) Or Me.lstsearch.Value = "" Then
MsgBox "Keinen Datensatz ausgewählt"
Exit Sub
End If
Dim stDocName As String
Dim stLinkCriteria As String
' The following is the variable definition for the error handler
On Error GoTo lstsearch_DblClick_Error
Dim ErrorForm As String
Dim ErrorControl As String
Dim ErrorCode As String
Dim ErrorNumber As String
ErrorForm = Nz(Screen.ActiveForm.Name, "No Form Loaded")
ErrorControl = Nz(Screen.ActiveControl.Name, "No Control Loaded")
' Procedure
stDocName = "Contacts"
stLinkCriteria = "[ContactID]=" & Me![lstsearch]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub
' Error handler
lstsearch_DblClick_Error:
ErrorNumber = Err.Number
ErrorCode = Err.Description
Call SendError(ErrorCode, ErrorNumber, ErrorControl, ErrorForm)
Exit Sub
End Sub
Private Sub CmdExit_Click()
' The following is the variable definition for the error handler
On Error GoTo CmdExit_Click_Error
Dim ErrorForm As String
Dim ErrorControl As String
Dim ErrorCode As String
Dim ErrorNumber As String
ErrorForm = Nz(Screen.ActiveForm.Name, "No Form Loaded")
ErrorControl = Nz(Screen.ActiveControl.Name, "No Control Loaded")
' Procedure
DoCmd.Close
Exit Sub
' Error handler
CmdExit_Click_Error:
ErrorNumber = Err.Number
ErrorCode = Err.Description
Call SendError(ErrorCode, ErrorNumber, ErrorControl, ErrorForm)
Exit Sub
End Sub
Private Sub cmdaddcustomer_Click()
' The following is the variable definition for the error handler
On Error GoTo cmdaddcustomer_Click_Error
Dim ErrorForm As String
Dim ErrorControl As String
Dim ErrorCode As String
Dim ErrorNumber As String
ErrorForm = Nz(Screen.ActiveForm.Name, "No Form Loaded")
ErrorControl = Nz(Screen.ActiveControl.Name, "No Control Loaded")
' Procedure
DoCmd.OpenForm "Contacts"
DoCmd.GoToRecord , , acNewRec
Exit Sub
' Error handler
cmdaddcustomer_Click_Error:
ErrorNumber = Err.Number
ErrorCode = Err.Description
Call SendError(ErrorCode, ErrorNumber, ErrorControl, ErrorForm)
Exit Sub
End Sub
Private Sub cmdquit_Click()
On Error GoTo cmdquit_Click_Error
On Error GoTo Err_CmdClose_Click
' Close the session for this user and flag them as logged out.
Call CloseSession
Call LogMeOff(LngLoginId)
DoCmd.Quit
Exit_CmdClose_Click:
Exit Sub
Err_CmdClose_Click:
MsgBox Err.Description
Resume Exit_CmdClose_Click
Exit Sub
cmdquit_Click_Error:
Dim ErrorForm As String
Dim ErrorControl As String
Dim ErrorCode As String
Dim ErrorNumber As String
ErrorForm = Nz(Screen.ActiveForm.Name, "No Form Loaded")
ErrorControl = Nz(Screen.ActiveControl.Name, "No Control Loaded")
ErrorNumber = Err.Number
ErrorCode = Err.Description
Call SendError(ErrorCode, ErrorNumber, ErrorControl, ErrorForm)
Exit Sub
End Sub
Private Sub cmdadmin_Click()
Dim stDocName As String
Dim stLinkCriteria As String
' The following is the variable definition for the error handler
On Error GoTo cmdadmin_Click_Error
Dim ErrorForm As String
Dim ErrorControl As String
Dim ErrorCode As String
Dim ErrorNumber As String
ErrorForm = Nz(Screen.ActiveForm.Name, "No Form Loaded")
ErrorControl = Nz(Screen.ActiveControl.Name, "No Control Loaded")
' Procedure
stDocName = "Admin Options"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub
' Error handler
cmdadmin_Click_Error:
ErrorNumber = Err.Number
ErrorCode = Err.Description
Call SendError(ErrorCode, ErrorNumber, ErrorControl, ErrorForm)
Exit Sub
End Sub
How can I know what is causing this and what is the fix?
mafhobb