D
Don Ireland
Ok,
I am working on another database. I tried coping the code from a previous
database that I developed and keep getting an error - Runtime 3070 - MS Jet
Database Enginer does not recognize "insert entered text here" as a valid
field.
Here is what I am trying to do:
Public Sub ItemFinder(LookingFor As String)
'On Error GoTo Err_ItemFinder
Dim RS As DAO.Recordset
Dim STrWhere As String
Dim Finder, SearchFailed
Select Case LookingFor
Case "Parent"
Finder = InputBox("Enter the last name of the Primary Parent to look
for", "Parent Finder")
Set RS = Forms![Primary].RecordsetClone
STrWhere = "[PrimaryLastName]=" & Finder
Case Else
Finder = MsgBox("Bug in Code.", vbOKOnly, "Invalid Search Parameter")
GoTo ExitRoutine
End Select
If Finder = "" Then GoTo ExitRoutine
RS.FindFirst STrWhere (This is where it craps out)
If RS.nomatch Then
SearchFailed = MsgBox("Item not found", vbExclamation + vbOKOnly,
"Error!")
Else
If LookingFor = "Parent" Then Forms![frmPrimaryInfo].Bookmark =
RS.Bookmark
End If
ExitRoutine:
Set RS = Nothing
Exit Sub
Err_ItemFinder:
MsgBox Err.Description
Resume ExitRoutine
End Sub
This routine works wonderfully well in the previous database - I pass it the
thing I am looking for and it locates it. I have checked the references in
both databases and they match. I started the databases on 2 seperate PC's
but I would think that would not matter since both PC's have the same version
of access installed.
The references I have loaded are :VB for applciations, MS Access 9.0 Object
Library, OLE Automation, ActiveX Data Object 2.1 Library, Office 9.0 Object
Library, MS Forms 2.0 Object Library, MS Windows Common Controls 6.0(SP6), &
MS DAO 3.6 Object Library.
The references are the same for both databases. I'm lost....any help would
be appreciated.
Thanks
Don
I am working on another database. I tried coping the code from a previous
database that I developed and keep getting an error - Runtime 3070 - MS Jet
Database Enginer does not recognize "insert entered text here" as a valid
field.
Here is what I am trying to do:
Public Sub ItemFinder(LookingFor As String)
'On Error GoTo Err_ItemFinder
Dim RS As DAO.Recordset
Dim STrWhere As String
Dim Finder, SearchFailed
Select Case LookingFor
Case "Parent"
Finder = InputBox("Enter the last name of the Primary Parent to look
for", "Parent Finder")
Set RS = Forms![Primary].RecordsetClone
STrWhere = "[PrimaryLastName]=" & Finder
Case Else
Finder = MsgBox("Bug in Code.", vbOKOnly, "Invalid Search Parameter")
GoTo ExitRoutine
End Select
If Finder = "" Then GoTo ExitRoutine
RS.FindFirst STrWhere (This is where it craps out)
If RS.nomatch Then
SearchFailed = MsgBox("Item not found", vbExclamation + vbOKOnly,
"Error!")
Else
If LookingFor = "Parent" Then Forms![frmPrimaryInfo].Bookmark =
RS.Bookmark
End If
ExitRoutine:
Set RS = Nothing
Exit Sub
Err_ItemFinder:
MsgBox Err.Description
Resume ExitRoutine
End Sub
This routine works wonderfully well in the previous database - I pass it the
thing I am looking for and it locates it. I have checked the references in
both databases and they match. I started the databases on 2 seperate PC's
but I would think that would not matter since both PC's have the same version
of access installed.
The references I have loaded are :VB for applciations, MS Access 9.0 Object
Library, OLE Automation, ActiveX Data Object 2.1 Library, Office 9.0 Object
Library, MS Forms 2.0 Object Library, MS Windows Common Controls 6.0(SP6), &
MS DAO 3.6 Object Library.
The references are the same for both databases. I'm lost....any help would
be appreciated.
Thanks
Don