Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export table to Excell? 1

Status
Not open for further replies.

jtfrier

Technical User
Jan 12, 2006
85
I have a table that I need exported to excell but I only want the information for a one year I have a date field in the table but when I try to filter the year */*/year It does not work. I also need to know how to export it to excell. Im using a button to open up excell her is the code that was auto generated. I was wanteing to have the user enter in a year and the the excell doc popup with the info for the year

Code:
Private Sub cmbExcell_Click()
On Error GoTo Err_cmbExcell_Click

    Dim oApp As Object

    Set oApp = CreateObject("Excel.Application")
    oApp.Visible = True
    'Only XL 97 supports UserControl Property
    On Error Resume Next
    oApp.UserControl = True

Exit_cmbExcell_Click:
    Exit Sub

Err_cmbExcell_Click:
    MsgBox Err.Description
    Resume Exit_cmbExcell_Click
    
End Sub
 
How exacty are you filtering the year for the query?

Have fun! :eek:)

Alex Middleton
 
all i did was put in =*/*/2006
 
Sorry, where did you put that criterion? Is this being run off an access query or SQL in code? Normally the criterion would look something like:

Code:
SELECT [Fields] FROM [Tables] 
WHERE Year([DateField]) = 2006

Have fun! :eek:)

Alex Middleton
 
It worked.Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top