Help! - Using seek with the data control

Help! - Using seek with the data control

Post by Stuart A Hil » Thu, 08 Aug 1996 04:00:00



I have the following code

 Set db = DBEngine.Workspaces(0)(0)
 Set rs = db.OpenRecordset("AddressBook", dbOpenTable)

 rs.Index = "companyAZ"
 rs.Seek "=", closeit

It successfully finds the record but I'm not too sure how to get the data
control to point to the found record. I tried

Set data1.recordset = rs

but that didn't work as the data control stayed at the first record and
not the found one.

Can you help me?

Stuart A Hill
London

 
 
 

Help! - Using seek with the data control

Post by Harry Stell » Fri, 16 Aug 1996 04:00:00



> I have the following code

>  Set db = DBEngine.Workspaces(0)(0)
>  Set rs = db.OpenRecordset("AddressBook", dbOpenTable)

>  rs.Index = "companyAZ"
>  rs.Seek "=", closeit

> It successfully finds the record but I'm not too sure how to get the data
> control to point to the found record. I tried

> Set data1.recordset = rs

> but that didn't work as the data control stayed at the first record and
> not the found one.

> Can you help me?

> Stuart A Hill
> London

Try using the data1.recordset.findfirst.  I have problems using the seek method.  The
findfirst will move the pointer to the first record.  From there use the
data1.recordset.findnext, findprevious, or findlast to move to any record.

 
 
 

Help! - Using seek with the data control

Post by Steve DeGeorge, S » Sat, 17 Aug 1996 04:00:00




>> I have the following code

>>  Set db = DBEngine.Workspaces(0)(0)
>>  Set rs = db.OpenRecordset("AddressBook", dbOpenTable)

>>  rs.Index = "companyAZ"
>>  rs.Seek "=", closeit

>> It successfully finds the record but I'm not too sure how to get the data
>> control to point to the found record. I tried

>> Set data1.recordset = rs

>> but that didn't work as the data control stayed at the first record and
>> not the found one.

>> Can you help me?

>> Stuart A Hill
>> London

>Try using the data1.recordset.findfirst.  I have problems using the seek method.  The
>findfirst will move the pointer to the first record.  From there use the
>data1.recordset.findnext, findprevious, or findlast to move to any record.

(1) make sure you are using a table object (Very inportant)

' --- set the index
RS.Index = "indexname"

' --- do the seek
RS.Seek "=", Var2Look4$

' --- check fo a match
If RS.NoMatch Then

--
==Steve DeGeorge SR    
==Sharkware Computing

 
 
 

1. Using "SEEK" with a Data Control

Hi All:

        I have a data control on one of my forms.  I have the databasename set to
a MS Access database and the recordset type as table.

        However, I cannot SEEK on the table (it generates an error).  I could not
find a property on the properties page to allow me to set the index name
and hence be able to perform a seek.

        Is it possible to do this or must I select the table as a Dynaset and use
the FindFirst method (slow as heck)?

All the best,

Kevin

2. Pick positions available

3. Finding/Seeking/setting the current record when using a data control

4. Moving sql7 database to another server

5. Using SEEK with Data Access Control ?

6. XP_SendMail from VB - passing parameters question

7. Need help with seek and data control.

8. Is the sky the limit? No.

9. Create User Control as Data Source Using ADO Data Control

10. Help: Using the datarepeater control with an ActiveX control containing an embedded datacombo control

11. Using VB5 to import data to access without using the Data control

12. Help ! ADO data control and standard data control

13. Using Access 97 replication ID's with VB5 data control and other bound controls