PDA

Click to See Complete Forum and Search --> : I need help - Why doesn't this search work?


brjames
Apr 12th, 2000, 01:37 AM
Can anyone tell me why this search won't work?
When run I get an error message saying OPERATION IS NOT SUPPORTED FOR THIS TYPE OF OBJECT.

It is searchg for a mooring number in a harbour management project I'm working on. The form tht it is on has information from two different tables displayed on it in text boxes. It has two data controls.

I would be grateful for any help

Cheers!

Code:Private Sub cmdFind_Click()
prompt$ = "Enter the full Mooring Number e.g 001 "

SearchStr$ = InputBox(prompt$, "Mooring Search")
Data2.Recordset.Index = "Mooring Number"
Data2.Recordset.Seek "=", SearchStr$
If Data2.Recordset.NoMatch Then
Data2.Recordset.MoveFirst
End If
End Sub

JHausmann
Apr 12th, 2000, 02:49 AM
If mooring number is supposed to be numeric, try:

Data2.Recordset.Seek "=", Val(SearchStr$)

Then visit Marty's answer in the General Section.

http://forums.vb-world.net/showthread.php?threadid=13956

[Edited by JHausmann on 04-12-2000 at 03:59 PM]