Re: deleting columns in table
- From: witek84@xxxxxxxxx <witek84gmailcom@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 6 Dec 2006 09:44:00 -0800
Yes but how choose empty column using query?
"Douglas J. Steele" wrote:
All you need is two queries, no code at all..
To delete the contents of the temp table, you need a Delete query:
DELETE * FROM TempTable
To repopulate the temp table with data from an existing table, you need an
INSERT INTO query:
INSERT INTO TempTable (Field1, Field2, Field3, ...)
SELECT Field1, Field2, Field3, ...
FROM MyTable
If there's data in MyTable that you don't want inserted into the temp table,
put an appropriate WHERE clause.
In general, any time you have to choose between using code and using a query
to do the same thing, always choose the query.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"witek84@xxxxxxxxx" <witek84gmailcom@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:89EE5839-43D0-4014-8E24-2D5D2BC960B0@xxxxxxxxxxxxxxxx
I want to delete in macro empty columns.
I've got 2 queries. First deleting all data in temp table. Second serch
all
records in table that have minimum one cell with data. that query put data
into temp table. But not every colums have data. I want that my macro
check
column and if in column we don't have data then will delete. I've creating
macros only in excel and Í don't know how write this macro. I know only
this:
dim val as integer
for x=1 to 10 'I have 10 columns in table
val=0
for y=1 to eof 'how is end of records in file in access??
if cells(x,y)<>empty then 'in excel I'm using cells I don't
know
in access is that same
val=val+1
end if
next j
if val<>0 then
'and now I want to delete column x
end if
next i
Thanks
- Follow-Ups:
- Re: deleting columns in table
- From: Douglas J. Steele
- Re: deleting columns in table
- References:
- Re: deleting columns in table
- From: Douglas J. Steele
- Re: deleting columns in table
- Prev by Date: Re: group/combine
- Next by Date: Re: group/combine
- Previous by thread: Re: deleting columns in table
- Next by thread: Re: deleting columns in table
- Index(es):
Relevant Pages
|