VBA Table update value

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

Guest

I am really new in Acces VBA. I thought it would be more or less the same as
Excel and Word, but it is quite different.

I have the following question. I have created a new database and table which
is updated via external data. I have added three more columns, which should
be filled based on the retreived data.

I tried to create a code in VBA, however nothing looks to work properly. I
only succeeded to do it by a form, however then I have to do it one by one
while I would like the code to run, after imported the data.

Thanks in advance
 
Agreed, VBA in Access is quite different than in Excel. The object models
are quite different, and the tasks they must achieve are different.

You could populate your extra fields after import by executing an Update
query:
1. Create a query into this table.

2. Change it to an Update query (Update on Query menu).
Access adds an Update row to the grid.

3. Enter the expression you want in the Update row under the new fields. For
example, if you wanted to copy a field name F2 into a field name MyField,
you would enter this into the Update row under MyField:
[F2]

4. Save the query.

You can now run it with this code:
dbEngine(0)(0).Execute "Query1", dbFailOnError
 
Back
Top