1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Access 2000 ADO CurrentProject Connection

Discussion in 'Business Applications' started by aktell, Feb 8, 2005.

Thread Status:
Not open for further replies.
  1. aktell

    aktell Thread Starter

    Joined:
    Jan 20, 2005
    Messages:
    4
    Hi there,

    Can anybody be of any HELP. I would like to figure out the following.

    Insteat of using any wizards or else I would like to connect some text boxes "within" Access 2000 with VBA. I have two tables which I like to connect to and fill my text boxes.
    There are some ideas I have but ................
    My concern is what Sub Procedure do I take in VBA ??? etc.

    I got the following from an MS Site.
    Code:
    Sub
    '---
    Dim cnn As ADODB.Connection
    Dim rst As ADODB.Recordset
    
    Set cnn = CurrentProject.Connection
    Set rst = New ADODB.Recordset
    
    With rst
    ' Open table-type Recordset object.
    .Open Source:=strTblName, _
          ActiveConnection:=cnn, _
          CursorType:=adOpenKeyset, _
          LockType:=adLockOptimistic, _
          Options:=adCmdTableDirect
    
    'How do  I specify my tables and than of course my text boxes etc. ???
    
    Set cnn = Nothing
    End Sub
    
    
    Thanks aktell :confused:
     
  2. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    You recordset is empty because you have not told it what to populate it with other than the table name. Create a SELECT statement based on the two tables.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/328024

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice