Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A small form question...

Status
Not open for further replies.

TaeShadow

Programmer
Aug 21, 2000
1
US

I have created a form in Access based on a table. There is one field in the
form that contains a numerical value. I would like to create a text box in which
the user can input a value and have the form update itself to the record that
corresponds to the value the user entered.

This is what I have so far: The name of the text box is Text96. The name of
the field is Jamb.

Private Sub Text96_BeforeUpdate(Cancel As Integer)
Dim rst As Recordset
Set rst = Me.RecordsetClone
rst.FindFirst "Jamb = " & Text96.Text
Me.Bookmark = rst.Bookmark
End Sub

However, this gives me a data type mismatch error. Please help.


Thank you.
 
"There is one field in the form that contains a numerical value."

At rst.FindFirst "Jamb = " & Text96.text you are searching for a text type instead of a numeric value type. Try

"Jamb = " & Text96.value

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top