0
votes

I have successfully imported excel sheet to access table called tblData using vba but the excel sheet has some empty cells, I need to change those fields in column F1 to the charecter "H". I'm good at excel vba but new to Access.

1

1 Answers

2
votes

You can generate an update query to perform this. You can create this using the create> query design in the top ribbon.

When you create a query add the table and click the update button.

Alternatively, right click and select "SQL view" and insert the following:

UPDATE tbldata SET tbldata.F1 = "H";

EDIT: the following is to update only the empty fields in column F1, as mentioned by @DarrenBartrup-Cook.

UPDATE tbldata SET tbldata.F1 = "H" WHERE tbldata.F1 Is Null;

This doesn't use VBA, its a query and uses SQL. You could add some additional VBA code to your import procedure but you would have to show us the existing code.