Yes, the data already exists...so I will try the Sub routine as you suggested alcapps. Here I thought normalizing the data was a good thing...but I think it has caused more headaches for me.
Yes, the data already exists...so I will try the Sub routine as you suggested alcapps. Here I thought normalizing the data was a good thing...but I think it has caused more headaches for me.
Thanks first time I've run into that.
When running Debug I get a Compile error:
User-defined type not defined
and it highlights... db As DAO.Database
You must have Microsoft ado 3.6 object library loaded in references which you find in Vba tools
You are running this code in Access 2003? DAO is the default recordset library in Access so the code should work. But see what happens when selecting the ADO library in VBA: Tools>References>Microsoft ActiveX Data Objects 2.x Library
However, I don't think you need the db variable, especially since it is referenced only once.
Try using the New qualifier in declaring the recordset variable. Does table name have spaces or special characters? To be safe, include [] in the code. Same would apply to field names.
Dim rst As New DAO.Recordset
strSQL = "Select * from [" & datTableName & "] where num is NULL order by ID, inkmark"
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I am running ACCESS 2010
My last post comments still apply to 2010.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Sorry for my ignorance, but do I call this from a form?
Call what - the procedure? Yes, if you want to. Create a button and put code in the click event.
Alternatively, if this is a one-time event, just put the code in a general module. Position cursor anywhere in the procedure and click Run from the VBA tool bar.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I tried run it while in the code and it pops up a macro window
The procedure must be in a general module, not behind a form.
How many records are involved in this exercise?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
There are 1417 records
So a few too many for a manual edit.
Is the code in a general module?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Yes; under (General); and under Modules
This is actually something I need to do with data often. Most of the data post processing is done in SAS or GIS which needs a flat file.