Is this possible?

Roelant

Registered User.
Local time
Today, 16:58
Joined
Apr 2, 2002
Messages
36
I have a string (a) with a value (example : “tbl1!id”) , is now possible to put a number in tbl1!id (what is a DAO field in a table) by using the string something like this :
String = 48
Without putting the 48 to the string but in that field in the table
Thank You

Koen
 
Can you repeat that, please? Explain in full as it doesn't make much sense at the moment.

i.e a string (a) then the (a) is never referred to again

48 is an numerical value and why would you want that as a string

A DAO field?
 
more info

Sorry if it not clear want I want to do.
I hope this makes it more clear. I want to give a string the name of a field in a dao.recordset

A = “tbl1!fieldname”
Then I want to put an numerical value into that dao field by using that string.
Why ? The fieldname depends of witch field the user want to put the value into.

Is this more clear?

Thank you
 
Like this?

Code:
Dim A As String

A = "YourFieldName"

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

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

With rs
    .AddNew
    .Fields(A) = "a text value"
    .Update
    .Close
End With

db.Close
 

Users who are viewing this thread

Back
Top Bottom