paul.hartland at fsmail.net
paul.hartland at fsmail.net
Mon Jun 9 08:58:32 CDT 2003
ok Susan, try the following code : Dim school As String Dim strFileName As String Dim mysql As String Dim qdf As QueryDef Dim db As Database Set db = currentdatabase school = InputBox("What School Number") 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.CreateQueryDef("Reading") strFileName = "T:\2002-2003\SchoolGrades\Data\Reading" & school & ".xls" qdf.SQL = mysql MsgBox "tablename = " & strFileName DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, qdf.Name, strFileName, True From: "Klos, Susan" <Susan.Klos at fldoe.org> Date: Mon 09/Jun/2003 13:37 GMT To: "'accessd at databaseadvisors.com'" <accessd at databaseadvisors.com> Subject: RE: RE: [AccessD] MOre help needed OK, Here I am now: Dim school As String Dim strFileName As String Dim mysql As String Dim qdf As QueryDef Dim db As Database Set db = currentdatabase 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 am now getting this message when I get to Set qdf = db.QueryDefs "Object Required" I have a query called "Reading" and I thought I had DIMmed everything. _______________________________________________ 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.