C
Chuckp
I'm entirely new to ADO in Access 2000 and I'm simply trying to reposition a
cursor back to the correct record in a form following a requery. I'm going
bit by bit (haven't gotten to the part where I actually have to display the
record in the form) but the I get a "Data type mismatch in criteria
expression" error when I try to open the recordset with the query below:
Dim cnn As ADODB.Connection
Dim rstview As ADODB.Recordset
Dim strISBN As String
Set rstview = New ADODB.Recordset
If Me.[Order: #] <> "" Then
Forms!frmBook![Order#] = Me.[Order: #]
strISBN = Forms!frmBook![ISBN: #]
Forms!frmBook.Requery
rstview.ActiveConnection = CurrentProject.Connection
rstview.CursorType = adOpenStatic
rstview.Source = "Select [Book Information].* from [Book Information]
Where [Book Information].[ISBN: #] = " & strISBN
^ this is the line it doesn't like
rstview.Open
rstview.Close
Set rstview = Nothing
Else
MsgBox ("You must put a value in the Order Number field")
End If
The idea is to get frmBook to display the updated [ISBN: #] as well as to
get a subform on the calling form to show updates.
Chuck
cursor back to the correct record in a form following a requery. I'm going
bit by bit (haven't gotten to the part where I actually have to display the
record in the form) but the I get a "Data type mismatch in criteria
expression" error when I try to open the recordset with the query below:
Dim cnn As ADODB.Connection
Dim rstview As ADODB.Recordset
Dim strISBN As String
Set rstview = New ADODB.Recordset
If Me.[Order: #] <> "" Then
Forms!frmBook![Order#] = Me.[Order: #]
strISBN = Forms!frmBook![ISBN: #]
Forms!frmBook.Requery
rstview.ActiveConnection = CurrentProject.Connection
rstview.CursorType = adOpenStatic
rstview.Source = "Select [Book Information].* from [Book Information]
Where [Book Information].[ISBN: #] = " & strISBN
^ this is the line it doesn't like
rstview.Open
rstview.Close
Set rstview = Nothing
Else
MsgBox ("You must put a value in the Order Number field")
End If
The idea is to get frmBook to display the updated [ISBN: #] as well as to
get a subform on the calling form to show updates.
Chuck