yes I'm making sure they are cleared. If I declare the extra unused string the code goes ahead and sets the strings to nothing. so it seems odd that it only fails if the last declared string is set to nothing.
when I am trying to declare some strings in my code it would appear the access doesnt seem to like my last declared string. I have to add a unused string at the end before it will move on. This only seems to happen if I set the last string to nothing.
heres a basic module for you to replicate...
thanks.
this was my finished code in the end:
Dim tdf As TableDef
For Each tdf In CurrentDb.TableDefs
If tdf.Name = "New_NB_Cust" Then
DoCmd.DeleteObject acTable, "Old_NB_Cust"
tdf.Name = "Old_NB_Cust"
End If
Next
I have to rename a table in my code so I can do some comparing. anyway If I run my code manually (or by running a macro that calls the code) everything works as it should. BUT if I call the macro from a batch file the docmd.rename part doesnt run. the rest of the code does.
heres a simple way...