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]

.



Relevant Pages

  • Re: Update existing values incrementally w/UPDATE SQL
    ... and in the book; Access 2007 VBA Programmer's Reference. ... As far as quotes go, this was one of the trickiest ... Consider vba's interpretation of a string: ... when an SQL is processed (I use an SQL example because it is the most ...
    (microsoft.public.access.modulesdaovba)
  • Re: Update existing values incrementally w/UPDATE SQL
    ... pretend that Me.txtString is a control on your form, ... You cant put Me.txtString inside the double quotes, or VBA just reads it as a ... and in the book; Access 2007 VBA Programmer's Reference. ... when an SQL is processed (I use an SQL example because it is the most ...
    (microsoft.public.access.modulesdaovba)
  • Re: Please help:need to read XML, edit, and write back to XML file
    ... I copied Astrid's code into a VBA module and ran it, ... give me any of the tags. ... string, as the scripting code gave me. ... reading, writing or appending. ...
    (microsoft.public.word.vba.general)
  • Re: My Selected print in the list box does not work
    ... Public Function BuildWhereCondition(strControl As String) As String ... Dim strWhereLst As String ... HERE IS THE VBA OF A COMMAND: ...
    (microsoft.public.access.formscoding)
  • Re: Trying to create dynamic VBA code (or wasting my time?)
    ... VBA isn't designed to handle self-modifying code. ... Operator As String) As Variant ... how to manipulate recordsets, having done so before. ... Dim stringBuff As String ...
    (microsoft.public.access.modulesdaovba)