variables into table cells

B

beeing

hi again

one question
i have a loop which creates variables on the basis of the text file line
how to paste a variables into the table cells

TH
b
 
N

Naresh Nichani MVP

Hi:

Assuming you have a variable say str1 of type string you could add this to a
table like this --

Dim db as DAO.Database
Dim rs as DAO.Recordset

Set db = CurrentDb()
Set rs = db.OpenRecordset("Select * from [YourTableToInsert]",dbOpenDynaset)
rs.AddNew
rs.Fields("YouFieldName") = str1
rs.Update
rs.Close
Set rs = nothing
Set db = Nothing

Regards,

Naresh Nichani
Microsoft Access MVP
 
B

beeing

Hi
Many thanks for response..

I have 'User-defined type not defined' error when i use Dim ... As DAO.Database. :
I have to look into this

You have some suggestions maybe

Regards


----- Użytkownik Naresh Nichani MVP napisał: ----

Hi

Assuming you have a variable say str1 of type string you could add this to
table like this -

Dim db as DAO.Databas
Dim rs as DAO.Recordse

Set db = CurrentDb(
Set rs = db.OpenRecordset("Select * from [YourTableToInsert]",dbOpenDynaset
rs.AddNe
rs.Fields("YouFieldName") = str
rs.Updat
rs.Clos
Set rs = nothin
Set db = Nothin

Regards

Naresh Nichan
Microsoft Access MV
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top