[AccessD] MOre help needed

paul.hartland at fsmail.net paul.hartland at fsmail.net
Mon Jun 9 08:36:03 CDT 2003


Does it give a clue as to where it is producing the error ?

From: "Klos, Susan" <Susan.Klos at fldoe.org>
Date: Mon 09/Jun/2003 13:25 GMT
To: "'accessd at databaseadvisors.com'" <accessd at databaseadvisors.com>
Subject: RE: RE: [AccessD] MOre help needed

Here is what I have so far:
 Dim school As String
    Dim strFileName As String
    Dim mysql As String
    Dim qdf As querydef
    
    
    school = InputBox("What School Number")
    'DoCmd.TransferSpreadsheet acExport, 8, "Reading",
"T:\2002-2003\SchoolGrades\Data\Reading" & school & ".xls", True, ""
    mysql = "SELECT ReadingGrade.DistSchNo, ReadingGrade.Grade,
ReadingGrade.LName, " & _
    "ReadingGrade.FName, ReadingGrade.IDSS, ReadingGrade.Curr03,
ReadingGrade.MatchFCAT02, " & _
    "ReadingGrade.LevelR03, ReadingGrade.LevelR02, ReadingGrade.DSS03R, " &
_
     "ReadingGrade.DSSR02 AS Expr1, ReadingGrade.SSR02, ReadingGrade.Lo25" &
_
    "FROM ReadingGrade WHERE (((ReadingGrade.DistSchNo)=" & school & "))"
    'MsgBox school

    Set qdf = db.QueryDefs("Reading")
     
     strFileName = "T:\2002-2003\SchoolGrades\Data\Reading" & school &
".xls"
     qdf.SQL = mysql
     MsgBox "tablename = " & strFileName
     
     DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, qdf.Name,
strFileName, True
I know at this point I am putting in the school numbers from an input box
but I knew how to do that.  I am getting this error message "User defined
type object not defined".  What references do I need to set? 

-----Original Message-----
From: paul.hartland at fsmail.net [mailto:paul.hartland at fsmail.net]
Sent: Monday, June 09, 2003 9:17 AM
To: accessd at databaseadvisors.com
Subject: Re: RE: [AccessD] MOre help needed


I'll try and get the code at some point, only pretty busy my end as
well.....but basically here's what I would do :

Open tblSchools as a recordset
Until eof tblShcools
   Create SQL query where parameter = tblSchools.Field
   Export the query to Excel (probably using TransferText method or similar
   move to next record of tblSchools
Loop
Close Recordset

Hope this helps 

Paul


From: "Klos, Susan" <Susan.Klos at fldoe.org>
Date: Mon 09/Jun/2003 12:57 GMT
To: "'accessd at databaseadvisors.com'" <accessd at databaseadvisors.com>
Subject: RE: [AccessD] MOre help needed

Actually this is more complicated than I thought.  I guess I need to use a
sql statement inside a loop and set a variable "school" to whatever record
the loop is on at the time.  Then export the query filled with the data.  I
could do this I know except that I am under the gun and my brain has gone
into overload.

-----Original Message-----
From: paul.hartland at fsmail.net [mailto:paul.hartland at fsmail.net]
Sent: Monday, June 09, 2003 8:48 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] MOre help needed


How are you exporting the query to Excel ?


From: "Klos, Susan" <Susan.Klos at fldoe.org>
Date: Mon 09/Jun/2003 12:42 GMT
To: "'accessd at databaseadvisors.com'" <accessd at databaseadvisors.com>
Subject: [AccessD] MOre help needed

I have a parameter query that exports a table to Excel.  I want the query to
pull the parameter from a field in another table (tblschools).  How do I do
that so that when I run the query it will export a separate spreadsheet for
every record in tblschools?
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


__________________________________________________________________________
Join Freeserve http://www.freeserve.com/time/

Winner of the 2003 Internet Service Providers' Association awards for Best
Unmetered ISP and Best Consumer Application.


_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


__________________________________________________________________________
Join Freeserve http://www.freeserve.com/time/

Winner of the 2003 Internet Service Providers' Association awards for Best
Unmetered ISP and Best Consumer Application.


_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


__________________________________________________________________________
Join Freeserve http://www.freeserve.com/time/

Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application.




More information about the AccessD mailing list