473,383 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

4 different questions.

Subject: Hiding field names.
I'm exporting a query with a lot of strings to Excel.
When exporting - is there any way to have the field name hidden or
removed from the query by default?
I don't need the field name as a heading on the excel sheet.

Subject: Empty columns in a query.
I'm exporting a query to Excel.
I need an empty column between one of the columns in excel.
Is there any way to add an empty column between one of the columns in
the query?

Subject: Exporting to Text (Tab Delimited)
When exporting - where can I add "Text (Tab Delimited) (*txt)" in the
save as type dropdown?
The same with "CSV (Comma delimited) (*.CSV"

Subject: Event for Exporting.
I would like to export a query to Excel by clicking on a command
button.
Can anyone please help write an event for a command button?

Thanks for your help.
Nov 12 '05 #1
5 5041

Subject: Empty columns in a query.

I'm exporting a query to Excel.

I need an empty column between one of the columns in excel.

Is there any way to add an empty column between one of the columns in

the query?

If your query is select firstname , lastname from clients and you want
an empty column between them just use a query like this

select firstname , '' as MyEmpty,lastname from clients
--
Posted via http://dbforums.com
Nov 12 '05 #2
"Jacky11" <my*****@hotmail.com> wrote in message
news:46**************************@posting.google.c om...
Subject: Hiding field names.
I'm exporting a query with a lot of strings to Excel.
When exporting - is there any way to have the field name hidden or
removed from the query by default?
I don't need the field name as a heading on the excel sheet.
I not sure what you mean by the above. Are you saying that you don't want
certain fields to be included in the export? Then simply build a query where
you leave those fields out. That is the whole idea as to why you use a query
in place of the table to export (you can choose whatever fields you want).
Subject: Exporting to Text (Tab Delimited)
When exporting - where can I add "Text (Tab Delimited) (*txt)" in the
save as type dropdown?
The same with "CSV (Comma delimited) (*.CSV"
Just choose text file,and give the data a file extension of csv. After you
type in the file name, and hit export, you are given additional options such
as TAB delimited etc. (the export wizard will launch AFTER YOU TYPE in the
file name and hit export).

Subject: Event for Exporting.
I would like to export a query to Excel by clicking on a command
button.
Can anyone please help write an event for a command button?


Check out the help files on TransferText Method
--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
ka****@msn.com
http://www.attcanada.net/~kallal.msn
Nov 12 '05 #3
my*****@hotmail.com (Jacky11) wrote in message news:<46**************************@posting.google. com>...
Subject: Hiding field names.
I'm exporting a query with a lot of strings to Excel.
When exporting - is there any way to have the field name hidden or
removed from the query by default?
I don't need the field name as a heading on the excel sheet.

Subject: Empty columns in a query.
I'm exporting a query to Excel.
I need an empty column between one of the columns in excel.
Is there any way to add an empty column between one of the columns in
the query?

Subject: Exporting to Text (Tab Delimited)
When exporting - where can I add "Text (Tab Delimited) (*txt)" in the
save as type dropdown?
The same with "CSV (Comma delimited) (*.CSV"

Subject: Event for Exporting.

....

Jacky,

1. When you use the export menu-ommand to crate a new worksheet then
you can't avoid the headers
- The headers could be hidden or deleted using a piece of VBA
automation code from an Access module. In that way tou could
accomplish also some layouting (column-withs etc.) if you want to
generate a presentable spreadsheet quickly.
- There is also another way of getting data from access into Excel as
a table in an existing Excel-worksheet in a fixed location by making a
linked Excel-table in Access, but a little more logical would it be to
use the query-tool within Excel to get table-data from Access and to
refresh the data from Excel when needed or when automatically when
opened. Possibly this is not what you want.

2. Just add a column containing '' or null as value and some
columnname in the query

3. You must use the export function and not 'save as'. Dont forget to
save the specification just before finishing. The name you save there
you could use it in a macro with a TransferText command.

4. You could create a menu-item or commandbutton on a form to start a
macro and/or VBA-procedure like in my example.

success, Marc

example based on one of my own applications:
I had a query to export to a spreadsheet and to do a little layouting
from access.
To hide the column-names you could add:
xl.application.selection.hidden = true

******** a macro
SetWarnings (no)
TransferSpreadsheet (Microsoft Excel 8-9; excellist; c:\excellist;
Yes; )
Runcode (sheetlayout())
MsgBox (Spreadsheet generated; Yes; None; )
******** the VBA-code:
Option Compare Database
Option Explicit

Public Function sheetlayout()
Dim xl As Object
Dim Name As String
On Error GoTo notopen
Set xl = GetObject(, "Excel.Application")
xl.Application.Visible = True
xl.Parent.windows(1).Visible = True
MsgBox "Excel still opened ... @please close first.", vbExclamation,
"Warning"
Exit Function
SheetOpen:
Name = InputBox("Filename xls-file:", "Save the result",
"c:\excellist")
Set xl = GetObject("c:\excellist.xls")
xl.Application.Visible = True
xl.Parent.windows(1).Visible = True
xl.sheets("excellist").Select
xl.sheets("excellist").Rows("1:1").Select
xl.Application.Selection.Font.Bold = True
'... here you could do the hiding of the columnname rows
xl.sheets("excellist").Columns("A:Q").Select
xl.Application.Selection.Columns.AutoFit
xl.sheets("excellist").Range("A1").Select
xl.Application.Selection.AutoFilter
xl.sheets("excellist").Rows("1:1").RowHeight = 25.5
xl.sheets("excellist").Rows("1:1").Select
xl.Application.Selection.VerticalAlignment = 1
xl.sheets("excellist").Range("A2").Select
xl.Application.activewindow.freezepanes = True
xl.Application.ActiveWorkbook.SaveAS (Name)
xl.Application.Quit
'xl.Application.Save
Set xl = Nothing
Exit Function
'Escape routine if Excel still open and busy ..
notopen:
If Err.Number = 429 Then Resume SheetOpen
MsgBox "Excel still opened, Please Close Excel first"
Exit Function
End Function
Nov 12 '05 #4
Thank you
It really saved me a lot of time.
But is there any way to automatically delete the single quotation mark
that gets added while exporting?
Also I have to export this to a text (Tab delimited) file. Can you
help me with this?

Thanks again

M.***********@uva.nl (Marc) wrote in message news:<ae**************************@posting.google. com>...
my*****@hotmail.com (Jacky11) wrote in message news:<46**************************@posting.google. com>...
Subject: Exporting to Text (Tab Delimited)
When exporting - where can I add "Text (Tab Delimited) (*txt)" in the
save as type dropdown?
The same with "CSV (Comma delimited) (*.CSV"

Subject: Event for Exporting.

...

Jacky,

4. You could create a menu-item or commandbutton on a form to start a
macro and/or VBA-procedure like in my example.

success, Marc

example based on one of my own applications:
I had a query to export to a spreadsheet and to do a little layouting
from access.
To hide the column-names you could add:
xl.application.selection.hidden = true

******** a macro
SetWarnings (no)
TransferSpreadsheet (Microsoft Excel 8-9; excellist; c:\excellist;
Yes; )
Runcode (sheetlayout())
MsgBox (Spreadsheet generated; Yes; None; )

Nov 12 '05 #5
Please see your code I'm using now.
Public Function sheetlayout()
On Error GoTo Err_Command1_Click
Dim xl As Object
Set xl = GetObject("c:\windows\desktop\123.csv")
xl.Application.Visible = True
xl.Parent.windows(1).Visible = True
xl.sheets("excellist").Select
xl.sheets("excellist").Rows("1:1").Select
xl.Application.selection.Delete = True
xl.Application.Save
xl.Application.Quit

Set xl = Nothing
Exit Function

Err_Command1_Click:
MsgBox Err.Description
Resume Next

Exit Function
End Function
However, after "xl.Application.selection.Delete = True" I'm getting a
message "Unable to set the delete property of the range class"
After "Resume Next" a new file is created on the Desktop with the name
Resume.
What am I doing wrong?
Please help!!
Thanks


M.***********@uva.nl (Marc) wrote in message news:<ae**************************@posting.google. com>...
my*****@hotmail.com (Jacky11) wrote in message news:<46**************************@posting.google. com>...
Subject: Exporting to Text (Tab Delimited)
When exporting - where can I add "Text (Tab Delimited) (*txt)" in the
save as type dropdown?
The same with "CSV (Comma delimited) (*.CSV"

Subject: Event for Exporting.

...

Jacky,
4. You could create a menu-item or commandbutton on a form to start a
macro and/or VBA-procedure like in my example.

success, Marc

example based on one of my own applications:
I had a query to export to a spreadsheet and to do a little layouting
from access.
To hide the column-names you could add:
xl.application.selection.hidden = true

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

137
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
8
by: TTroy | last post by:
I have a few questions about "scope" and "visibility," which seem like two different things. To me "visibility" of the name of a function or object is the actual code that can use it in an...
5
by: Wysiwyg | last post by:
I'm new to c# programming and can't figure out how to avoid duplicating common code in multiple classes when I'm restricted to using different system base classes.. I'm using c# in asp.net to write...
5
by: Juan T. Llibre | last post by:
OK, guys, usually I answer questions instead of asking them, but this thing has me scratching my head. Why is the default for AutoEventWireup different for C# and VB.NET ? In VS 2005, if I...
1
by: David Gaudine | last post by:
(This is a bit like the recent thread "PHP Switching Sessions".) I use session_start(). When I open my web-based application in two windows on the same system, there's a definite clash; I can't...
2
by: viveklinux | last post by:
Hi, Have a FAQ page , where have many sets of questions and answers. The questions need to be a different colour / style and the answers different. Was wondering is there a easy way to do this...
26
by: Cliff Williams | last post by:
Can someone explain the pros/cons of these different ways of creating a class? // 1 function myclass() { this.foo1 = function() {...} } // 2a
10
by: schneider | last post by:
I'm looking for a way to programaticly call a method from a different object and associate the two objects at runtime. Example: Object A exist and is unknow, I want object B to be able to call a...
4
by: Kid Programmer | last post by:
It seems like most of the questions on this forum are just involving different browsers. No one asks questions about
5
by: Christopher Brewster | last post by:
I am running the same script on the same data on two different machines (the folder is synchronised with Dropbox). I get two different results. All the script does is count words in different...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.