Access 2000 ADO CurrentProject Connection

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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:
 
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.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Top