accessfever
Registered User.
- Local time
- Yesterday, 16:32
- Joined
- Feb 7, 2010
- Messages
- 101
I have a simple VBA code to opoen a query based on an input of one "Plant number".
My code is as follow:
*****************************
Private Sub cmdOpenQuery_Click()
'Debug.Print Me.cboPlant <- Original code to enter a plant number
cboPlant = "1100"
DoCmd.OpenQuery "QtyDataByPlant"
End Sub
*****************************
What I wanted to accomplish here is to change the codes above to an "OutputTo" function with hard-coded 13 plant numbers inside the codes. I wanted to push the button then Access will export the query to 13 excel files automatically.
Any suggestion!
My code is as follow:
*****************************
Private Sub cmdOpenQuery_Click()
'Debug.Print Me.cboPlant <- Original code to enter a plant number
cboPlant = "1100"
DoCmd.OpenQuery "QtyDataByPlant"
End Sub
*****************************
What I wanted to accomplish here is to change the codes above to an "OutputTo" function with hard-coded 13 plant numbers inside the codes. I wanted to push the button then Access will export the query to 13 excel files automatically.
Any suggestion!