
Originally Posted by
yrstruly
I tried the randomizer, im getting an error. I have attached the file.
Thanks. You've found a flaw in my code but its due to a flaw in yours.
You have spaces in table and field names which sql doesn't quite like. I never have spaces in any object names and neither should you.
In code you need to wrap object names with spaces in brackets [ ]
The error occurs in this line
Code:
strSql = "select " & fld & " from " & tbl & " where " & fld & " is not null"
I'll have to go back and re-post with the following change:
Code:
strSql = "select [" & fld & "] from [" & tbl & "] where [" & fld & "] is not null"
here's an updated copy
DataRandomizer2025.accdb
If this helped, please click the star * at the bottom left and add to my reputation- Thanks