Help with the SEEK command 
Author Message
 Help with the SEEK command

I am a very new VB programmer, and require help with the SEEK command.

When I perform a search using an index, if the value is NOT found I get a
VB error saying "No current record"

Any ideas on how to stop this annoying little mesage would be very helpful,
as I have my own error trap which follows.

Please help!

Rob Brown



Tue, 17 Apr 2001 03:00:00 GMT  
 Help with the SEEK command
Hi Rob,

The no current record is not fired when seek returns NoMatch, but when the table or
recordset is empty. So :

if TheTable.RecordCount >0 then
    TheTable.Index = "PrimaryKey" 'for example
    TheTable.Seek "=", "33" 'for example
    if Not TheTable.NoMatch then
        'you've found a record
    else
        'no record found
    end if
end if

Regards.

Christian Hugoud



Tue, 17 Apr 2001 03:00:00 GMT  
 Help with the SEEK command
: I am a very new VB programmer, and require help with the SEEK command.

: When I perform a search using an index, if the value is NOT found I get a
: VB error saying "No current record"

: Any ideas on how to stop this annoying little mesage would be very helpful,
: as I have my own error trap which follows.

I also a new VB programmer and also encounter your problem.
Are you using the "data", if yes, don't assign databasename and record
source at the design time, when I remove them, and assign them during
the running of the program, my problem is solved! Then you can use the
no match function to check the error.

K



Thu, 19 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help: Seek command won't seek

2. Help for seek command

3. sought after qbasic command?

4. sought after qbasic command?

5. seek command

6. Problem using SEEK command. VB4->Access

7. Lock on seek command

8. Linking Data1 scroll position with seek command result

9. Linking Data1 scroll position with seek command result

10. Does SQL 7 Support Index and Seek commands

11. ADO, Seek Command

12. CD Audio SEEK command

 

 
Powered by phpBB® Forum Software