No point getting into an endless semantic argument, but if you consistently
use the same field names, it's certainly conceivable that you might have the
following SQL statements where it doesn't make sense for Table1 and Table2
to be the same table:
UPDATE Table1 SET ConfirmationDate = Date() WHERE ConfirmedFG = True
UPDATE Table2 SET ConfirmationDate = Date() WHERE ConfirmedFG = True
Heck, you could even be talking about
SELECT * FROM Table1
SELECT * FROM Table2
<grin>
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"tina" <(E-Mail Removed)> wrote in message
news:O9ehh.513536$(E-Mail Removed)...
> <pickier>
>
> but if you can run the same SQL statement on two different tables by
> changing only the table name, they must be identical but for the table
> name.
> sounds to me like that should be one table, with a field to hold whatever
> data is currently stored in the table name... 
>
>
> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
> news:(E-Mail Removed)...
>> <picky>
>>
>> CurrentDb.QueryDefs("QueryName").SQL = _
>> Replace(CurrentDb.QueryDefs("QueryName").SQL, "Table1", "Table2")
>>
>> or, more efficiently,
>>
>> Dim qdfCurr As DAO.QueryDef
>>
>> Set qdfCurr = CurrentDb.QueryDefs("QueryName")
>> qdfCurr.SQL = Replace(qdfCurr.SQL, "Table1", "Table2")
>> </picky>
>>
>> 
>>
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no private e-mails, please)
>>
>>
>> "tina" <(E-Mail Removed)> wrote in message
>> news:Sa9hh.221344$(E-Mail Removed)...
>> > try
>> >
>> > CurrentDb.QueryDefs("QueryName").SQL = "type the entire SQL
>> > statement
>> > here"
>> >
>> > note that you have to set the SQL property of the QueryDef to a
>> > complete
>> > SQL
>> > statement - you can't just change "bits and pieces" of it.
>> >
>> > hth
>> >
>> >
>> > "thread" <(E-Mail Removed)> wrote in message
>> > news:(E-Mail Removed)...
>> >> Hi all,
>> >> I'm trying to find a way to change the sentece of the sql inside the
>> >> query via vba code
>> >> for now no clue
>> >>
>> >
>> >
>>
>>
>
>