If you can get the name of the column in your code as a string you may 
reference the column using this syntax: 



<tablename>.field("<string of column name>") 



Hope it helps  




----- Original Message ----- 
From: "jsivanan" <[email protected]> 
To: [email protected] 
Sent: Friday, May 21, 2010 3:42:56 PM GMT -05:00 US/Canada Eastern 
Subject: [Access VBA Central] Indirect Reference Table update? 

  




If I have a tableA with columns table_name, column_name , column_value 
can I read tableA and use it to add the data items specified in the columns of 
tableA? 

For instance: 
table_name col1_name col1_value col2_name col2_value 
Employee emp_name Joe Smith birthdate 1/1/50 
Employee emp_name Steve Jones birthdate 3/10/53 
Transaction Tdate 3/1/2010 Tamount 35.00 
Transaction Tdate 3/1/2010 Tamount 25.00 

1) The program would open the table specified in the table_name 
(That's the easy part since you can open a table specified by a string) 
2) Then append a row to the table with the col1_value assigned to 
the column specified in col1_name and the col2_value assigned to the column 
specified in col2_name? 

Normally you know the column_names when you write the program and 
code: 
Table!Column = Value 

But can you update a column not knowing it in advance? I.e. can you dynamically 
compose an sql insert statement and execute it in access? 

Thanks, 
Jnana 




[Non-text portions of this message have been removed]

Reply via email to