The usual 3464 data mismatch question.

G

Guest

Hi guys:

I am hoping somebody may be able to help. I have a very simple code in a
combo box. The code is below. The proble is that I keep on getting a Data
Type Mismatch error when ever I try to run it. Just FYI the PC_Tag_Number is
a text field composed of numbers.

Private Sub Combo59_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[PC_Tag_Number] = " & Str(Nz(Me![Combo59], 0))

If rs.NoMatch Then
MsgBox "Not Found"
Else
Me.Bookmark = rs.Bookmark
End If
End Sub

Any help is greatly appreciated.

Celia
 
D

Douglas J. Steele

rs.FindFirst "[PC_Tag_Number] = '" & Str(Nz(Me![Combo59], 0)) & "'"

You'd also be better off using

Dim rs As DAO.Recordset
 
G

Guest

Doub:

Thank you so much for your help. It solved my problem.

Celia


Douglas J. Steele said:
rs.FindFirst "[PC_Tag_Number] = '" & Str(Nz(Me![Combo59], 0)) & "'"

You'd also be better off using

Dim rs As DAO.Recordset


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Celia said:
Hi guys:

I am hoping somebody may be able to help. I have a very simple code in a
combo box. The code is below. The proble is that I keep on getting a
Data
Type Mismatch error when ever I try to run it. Just FYI the PC_Tag_Number
is
a text field composed of numbers.

Private Sub Combo59_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[PC_Tag_Number] = " & Str(Nz(Me![Combo59], 0))

If rs.NoMatch Then
MsgBox "Not Found"
Else
Me.Bookmark = rs.Bookmark
End If
End Sub

Any help is greatly appreciated.

Celia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top