Beginner trying to set table values from VBA (1 Viewer)

-ian-

Registered User.
Local time
Today, 16:03
Joined
Apr 12, 2002
Messages
32
I have been looking through this forum trying to find out how to edit a table from a piece of form VBA. I get the feeling I have to use recordset, but I have no idea what recordset does.

In brief, I store a list of numbers in a table text field: 13;12;32;114;542;2 this corresponding to a set of unique items. Each individual number is entered from a form textbox, so at the end I need to collect all the numbers together, make it into a string and then store it in the table.

This is probably not clear, but I would appreciate some pointers.
 

-ian-

Registered User.
Local time
Today, 16:03
Joined
Apr 12, 2002
Messages
32
I have now tried to use recordset, extracting the framework from others in the forum, but I get a Compile error: User defined type not found for the dim'ing of the Database!

The code is:

Private Sub form_current()
Dim db As DATABASE '-----> error here!
Dim rs As Recordset


Set db = CurrentDb()
Set rs = db.OpenRecordset("Temp_comp_items")


I am using Access2000. Is there something I need to install?
 

-ian-

Registered User.
Local time
Today, 16:03
Joined
Apr 12, 2002
Messages
32
OK. I'm all on my lonesome, but just for others out there.....

Some previous postings mention that Access 2000 has some changes and the Database Access Object Library (which I seemingly need) is not installed as standard.

In the Visual Basic Editing window, goto tools and you should see the references option there to add the DAO library.

In my cases, references was greyed out so I had created a new database and imported all my tables forms and code.
 

Users who are viewing this thread

Top Bottom