Input of Multiple Data

W

weircolin

Hi

I am wanting to enter in the same data into a table without having to
enter it several times (close to 100). Is there anyway to do this?

Colin
 
T

TonyT

Hi,

Use an SQL statement to do it for you;

Dim strSQL as String

strSQL = "UPDATE tblMyTable SET fldName = X WHERE fldName2 = Y"
DoCmd.RunSQL

or even better use
db.execute strSQL, dbFailOnError
which will let you know if the changes failed.

hope that helps,

TonyT..
 
W

weircolin

Hi Tony

Thanks for that. Will that work if I'm wanting to basically copy the
same data (about 6 fields) 80 times?

Colin
 
T

TonyT

Hi again,

that will update every value in fieldname to x where fldname2 has the value
Y. If you have more fields in the same table to udpate, separate them with a
comma. You can also have multiple WHERE criteria too.
If you are not sure what you are doing with UPDATE SQL code I strongly
recommend you make a back-up copy before trying any code!

TonyT..
 
Top