Converting AutoNumber to text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My primary key in one of my tables is defined as an autonumber. However, in a
Findrecord I need this object text. What command should I use to convert
autonumber to text?
 
CStr. But you shouldn't really need to do it. Any more detail on what's
going wrong?
 
Hi Rob:

I was modifing the below procedure to fit my requirements:-

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[pkEmployerID] = '" & Me![cboFindRecord] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

However, in this example pkEmployerID is a text while my search key is an
autonumber. Any thoughts?

Ken
 
Ken said:
Hi Rob:

I was modifing the below procedure to fit my requirements:-

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[pkEmployerID] = ' " & Me![cboFindRecord] & " ' "
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

However, in this example pkEmployerID is a text while my search key
is an autonumber. Any thoughts?

Get rid of the single quotes and you're set to go. I added spaces above to make
them easier to see.
 
Back
Top