variables into table cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 
Back
Top