Re: Code not working correctly

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Lookup Reddicks Naming Conventions for guidelines on how to name things in
vba... thats where I got my foundation from and (as far as I know) its
basically the standard.

I don't have any links handy but its easily googlable.

"kateri4482" wrote:

That is exactly the case. When I originally set up the table I had a field
called "Date" until I realized that is not a good idea, so I created a new
field but forgot to delete the old one. Thanks for the help!

"Marshall Barton" wrote:

kateri4482 wrote:

I have the following code running from a command button, and it ignores the
section after the "&" sign in the strTableName statement, so it just gives me
a Table called tblBackupEnhancedCodes without the date. I can't figure out
what I am doing wrong. I want to run this periodically and create a backup
of a table but add the current date to the end of it.

Dim strTableName As String, strSQL As String

strTableName = "tblBaclupEnhancedCodes" & Format(Date, "ddmmmmyy")

strSQL = "Select tblEnhancedCodes.* Into " & strTableName & " From
tblEnhancedCodes;"


You probably have a text box named Date and its value is
Null.

If so, it's just another reminder not to use reserved words
when you make up names.

--
Marsh
MVP [MS Access]

.


Quantcast