S
Sue R
I have searched through numerous forums looking for an answer, but could not
find one with the exact problem, but I apologize in advance if it's out there
and I missed it.
I have taken over a database at work from a previous employee so am lost...
When attempting to open a form from a command button at startup I receive the
message "Run-time error '3075': Extra ) in query expression '??empInformation.
EmpReferenceID="2239-EMP-01"))'.
I can not find an expression that looks like this anywhere in the database.
When I select Debug the following code comes up: (With the line "frmMain.
OrderBy = "EmpLastName DESC" highlighted).
Option Compare Database
Option Explicit
Dim rsMain As ADODB.Recordset
Sub modSetReferenceID(frmMain As Form, strIDValue1 As String, strIDValue2 As
String, txtReference As TextBox)
rsMain.Requery
txtReference.SetFocus
If txtReference.Text = "" Then
If rsMain.RecordCount <= 8 Then
txtReference.Value = strIDValue1 & rsMain.RecordCount + 1
Else
txtReference.Value = strIDValue2 & rsMain.RecordCount + 1
End If
End If
End Sub
Sub modDataInputLoad(frmMain As Form, strTableName As String, txtReference As
TextBox)
txtReference.Locked = True
frmMain.OrderByOn = True
frmMain.OrderBy = "EmpLastName DESC"
Set rsMain = New ADODB.Recordset
rsMain.CursorLocation = adUseClient
rsMain.Open "SELECT * FROM " & strTableName, CurrentProject.Connection,
adOpenDynamic, adLockOptimistic
End Sub
Thank you so much to anyone with a suggestion!
Sue
find one with the exact problem, but I apologize in advance if it's out there
and I missed it.
I have taken over a database at work from a previous employee so am lost...
When attempting to open a form from a command button at startup I receive the
message "Run-time error '3075': Extra ) in query expression '??empInformation.
EmpReferenceID="2239-EMP-01"))'.
I can not find an expression that looks like this anywhere in the database.
When I select Debug the following code comes up: (With the line "frmMain.
OrderBy = "EmpLastName DESC" highlighted).
Option Compare Database
Option Explicit
Dim rsMain As ADODB.Recordset
Sub modSetReferenceID(frmMain As Form, strIDValue1 As String, strIDValue2 As
String, txtReference As TextBox)
rsMain.Requery
txtReference.SetFocus
If txtReference.Text = "" Then
If rsMain.RecordCount <= 8 Then
txtReference.Value = strIDValue1 & rsMain.RecordCount + 1
Else
txtReference.Value = strIDValue2 & rsMain.RecordCount + 1
End If
End If
End Sub
Sub modDataInputLoad(frmMain As Form, strTableName As String, txtReference As
TextBox)
txtReference.Locked = True
frmMain.OrderByOn = True
frmMain.OrderBy = "EmpLastName DESC"
Set rsMain = New ADODB.Recordset
rsMain.CursorLocation = adUseClient
rsMain.Open "SELECT * FROM " & strTableName, CurrentProject.Connection,
adOpenDynamic, adLockOptimistic
End Sub
Thank you so much to anyone with a suggestion!
Sue