Code from Access 2.0 not working in Access 2000 
Author Message
 Code from Access 2.0 not working in Access 2000

I am updating a database from Access 2.0 to
Access 2000.  I have a form that runs and event
code that I can't get to function.  In the code I
create a table from existing records and then run
an update query to add values to empty fields.  I
can not manipulate the SQL statement of my
temporary query to create an update query in
Access 2000.

When I run the following code:
    Set myQdf = myDB.CreateQueryDef
("") 'TempReserveTable
    myQdf.SQL = "UPDATE ReserveAppend SET
ReserveAppend.Prefix = 'V', " _
               & "ReserveAppend.Suffix = ' ',
ReserveAppend.LD = '" _
               & LD & "', ReserveAppend.Project
= '" & Project & "', ReserveAppend.[REMARKS 2]
= " _
               & "'Valve number set aside '" &
Date & ";"
ReserveAppend to add the desired project name
the value of myQdf.SQL is never set to the string
and remains empty.  Any suggestions would be
greatly appreciated.

Brian Johnston

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Tue, 28 Jan 2003 03:00:00 GMT  
 Code from Access 2.0 not working in Access 2000
Hi Brian,
This works in A97.
Just to check, you do know that to actually
run the query you must execute it.
db.Execute(myQdf.Sql)
hth
Dan
Quote:

> I am updating a database from Access 2.0 to
> Access 2000.  I have a form that runs and event
> code that I can't get to function.  In the code I
> create a table from existing records and then run
> an update query to add values to empty fields.  I
> can not manipulate the SQL statement of my
> temporary query to create an update query in
> Access 2000.

> When I run the following code:
>     Set myQdf = myDB.CreateQueryDef
> ("") 'TempReserveTable
>     myQdf.SQL = "UPDATE ReserveAppend SET
> ReserveAppend.Prefix = 'V', " _
>                & "ReserveAppend.Suffix = ' ',
> ReserveAppend.LD = '" _
>                & LD & "', ReserveAppend.Project
> = '" & Project & "', ReserveAppend.[REMARKS 2]
> = " _
>                & "'Valve number set aside '" &
> Date & ";"
> ReserveAppend to add the desired project name
> the value of myQdf.SQL is never set to the string
> and remains empty.  Any suggestions would be
> greatly appreciated.

> Brian Johnston

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Tue, 28 Jan 2003 03:00:00 GMT  
 Code from Access 2.0 not working in Access 2000
Thanks for the reply Dan, but my problem is that when I try to run the
code all I get for the SQL is an empty string so it can not be
executed.  (I was attempting to use the DoCmd syntax)  As I said, the
basic concept functioned in Access 2.0 but I don't know how to update
it for Access2000.

Further up in my code I used the query def to create a make table
query, and then I tried to redefine the SQL and use the same object to
perform a different function I can not get any results.

I'm just a self taught amateur code writer and this has me stumped,

Thanks
Brian



Quote:
> Hi Brian,
> This works in A97.
> Just to check, you do know that to actually
> run the query you must execute it.
> db.Execute(myQdf.Sql)
> hth
> Dan


> > I am updating a database from Access 2.0 to
> > Access 2000.  I have a form that runs and event
> > code that I can't get to function.  In the code I
> > create a table from existing records and then run
> > an update query to add values to empty fields.  I
> > can not manipulate the SQL statement of my
> > temporary query to create an update query in
> > Access 2000.

> > When I run the following code:
> >     Set myQdf = myDB.CreateQueryDef
> > ("") 'TempReserveTable
> >     myQdf.SQL = "UPDATE ReserveAppend SET
> > ReserveAppend.Prefix = 'V', " _
> >                & "ReserveAppend.Suffix = ' ',
> > ReserveAppend.LD = '" _
> >                & LD & "', ReserveAppend.Project
> > = '" & Project & "', ReserveAppend.[REMARKS 2]
> > = " _
> >                & "'Valve number set aside '" &
> > Date & ";"
> > ReserveAppend to add the desired project name
> > the value of myQdf.SQL is never set to the string
> > and remains empty.  Any suggestions would be
> > greatly appreciated.

> > Brian Johnston

> > Sent via Deja.com http://www.deja.com/
> > Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Fri, 31 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Access 2000 VBA code not working Access 2002

2. Convert Access 2.0 Code to Access 2000

3. DLL usage - works in Access 97 but not in Access 2000

4. SQL string not works in VB and works in Access 2000

5. Importing an Access 2000 table into another Access 2000 database with VB Code

6. Convert access 2.0 to access 2000 database

7. Upgrade Access 2.0 to Access 2000

8. ApplyFilter not working in Access 2000

9. Step into - F8 not working correctly in Access 2000

10. DAO not working in Access 2000

11. Multiuser adds in Access 2000 not working

12. Access 2000 format not working

 

 
Powered by phpBB® Forum Software