Output to from macro (1 Viewer)

md-rahim

Registered User.
Local time
Today, 16:50
Joined
Dec 7, 2012
Messages
36
I create a macro for export access data. When I run it then appear the output to command box with some file format but selection option and all option is disable. How I can enable those option? Because I want to export some selected row. Please anybody help me
 

Alansidman

AWF VIP
Local time
Today, 04:50
Joined
Jul 31, 2008
Messages
1,493
Suggest you post your code that you are using. Explain what you are getting for a result. What you want to see for a result. Sample data is easier to analyze.
 

md-rahim

Registered User.
Local time
Today, 16:50
Joined
Dec 7, 2012
Messages
36
there is no code. there is a command button and link to a macro by on click property from button properties. I want to Export some selected row data from an access table. The macro is Output to command created. But there selection option is disable. How I can enable the selection option from output to.
 

Alansidman

AWF VIP
Local time
Today, 04:50
Joined
Jul 31, 2008
Messages
1,493
Sorry, I cannot help. I don't use macros. Only VBA code. Hopefully, some one else will jump in. In the meantime, suggest you upload your db for analysis as it will be easier to diagnose.
 

md-rahim

Registered User.
Local time
Today, 16:50
Joined
Dec 7, 2012
Messages
36
Ok, can u give me some code? I want to export some selected row from a access table into excel by clicking a button. Is it possible? plz help me.
 

mahenkj2

Registered User.
Local time
Today, 15:20
Joined
Apr 20, 2012
Messages
459
With Macro also, it should be possible to do what you need but as suggested you need to post your sample dB. Can you do that please?
 

md-rahim

Registered User.
Local time
Today, 16:50
Joined
Dec 7, 2012
Messages
36
Plz see the attachment, here is an output to command in Export in excel button but selection option is disable, how can I enable selection option to select required row. plz help
 

Attachments

  • for access forum.mdb
    468 KB · Views: 123

mahenkj2

Registered User.
Local time
Today, 15:20
Joined
Apr 20, 2012
Messages
459
That option shall only be enabled when you first select the record. So table should open first, then you select the record and then outputTo macro should fire.
 

md-rahim

Registered User.
Local time
Today, 16:50
Joined
Dec 7, 2012
Messages
36
plz how I can first open Table then selection and output to. Remember When it will run by user then all access menu will be disable from start up.
 

mahenkj2

Registered User.
Local time
Today, 15:20
Joined
Apr 20, 2012
Messages
459
What is your selection criteria? There are ways you can limit the records and then all records could be transferred.

You can make a query based on that criteria and then in outputTo you can use that query.
 

md-rahim

Registered User.
Local time
Today, 16:50
Joined
Dec 7, 2012
Messages
36
Output to option is work on Table to select require data. But I can not output to selected data through a query. How I can do it?? plz help me
 

md-rahim

Registered User.
Local time
Today, 16:50
Joined
Dec 7, 2012
Messages
36
Hi mahenkj2

few days ago u advice me how to export some selected data from access table into excel. It was great!

But now I need to export some selected data from access query into excel. Already I created a query and there have 02 expression for sum.

Plz help me.
 

Alansidman

AWF VIP
Local time
Today, 04:50
Joined
Jul 31, 2008
Messages
1,493
Here is an example that I have used in the past.
 

Attachments

  • Export to Excel.mdb
    432 KB · Views: 133

md-rahim

Registered User.
Local time
Today, 16:50
Joined
Dec 7, 2012
Messages
36
Is it possible to select Month & Year from a list box to generate report in excel?
 

Alansidman

AWF VIP
Local time
Today, 04:50
Joined
Jul 31, 2008
Messages
1,493
Are you generating the report in Excel or are you exporting to Excel? If exporting, are you attempting to export a query or a report. There is a big difference. Please be clear in your requirements. I am confused by your question and depending on what you are attempting to do will dictate a very different answer. Please try to use terms that are correct for the event you are trying to execute. Examples help us to understand your requirements.
 

md-rahim

Registered User.
Local time
Today, 16:50
Joined
Dec 7, 2012
Messages
36
Dear Alan,

Sorry! You're right. Actually I want to exporting a query into Excel. In my database have a month field and Year field. Query also contains those two field. So, how can I export query data to excel by selecting year & month? Plz.
 

Alansidman

AWF VIP
Local time
Today, 04:50
Joined
Jul 31, 2008
Messages
1,493
You would write your query in this fashion:

Code:
SELECT yourtablename.yourfieldname1, yourtablename.yourfieldname2, yourtablename.yourfieldmonthname, yourtablename.yourfieldyearname
FROM yourtablename
WHERE yourfieldmonthname = [type your month] and yourfieldyearname = [type your year];

Add as many fieldnames as necessary to complete your query.

Here is a good resource for learning Access.

Once you have your query completed, then right click on the query in the Navigation pane, and follow the wizard for exporting to Excel.

http://www.accessmvp.com/strive4peace/

I think that if you read this, your questions on these very basic skills will be answered.
 

Users who are viewing this thread

Top Bottom