(HELP) moving fields; changing field order

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm wondering what the code would be to change Field(4) or Field("ABC") to
Field(2)-- sliding the rest to the right + 1.

If there isn't a way, I'll have to create the 3 new fields, then
delete/remake the 10 following the 3 fields, which i'm not excited about =(

Thanks so much for any help.
 
hi,
If there isn't a way, I'll have to create the 3 new fields, then
delete/remake the 10 following the 3 fields, which i'm not excited about =(
Field order in databases is meaningless. When you need specific order
you make a query with an appropriate field list.



mfG
--> stefan <--
 
I'm curious because I have to export it to excel, and I don't know how to
change the column order in excel from access-- so I'm stuck with changing the
order in access instead. =(
 
OH so, a Table Query to make a new table in a different order!
Wow that would be a lot easier than the other options thanks so much!
 
hi,
OH so, a Table Query to make a new table in a different order!
Wow that would be a lot easier than the other options thanks so much!
:)


mfG
--> stefan <--
 
I'm curious because I have to export it to excel, and I don't know how to
change the column order in excel from access-- so I'm stuck with changing the
order in access instead. =(

You can export a Query to Excel just as easily, and in just the same way, as
you can export a Table. Just create a query with the fields in the desired
order (you can even exclude some fields if they're not needed) and export that
Query.

John W. Vinson [MVP]
 
OH so, a Table Query to make a new table in a different order!

You don't even need to do THAT. See my other reply in this thread.

Queries are your friends... get to know them! <g>

John W. Vinson [MVP]
 
So I should export a select query?

John W. Vinson said:
You don't even need to do THAT. See my other reply in this thread.

Queries are your friends... get to know them! <g>

John W. Vinson [MVP]
 
I have to run the cross-tab query that's being exported as a SQL statement
because check boxes on a form are determining which fields are in the query.

Can I export the SQL statement? I can't imagine how I'd do that...

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel3, DoCmd.RunSQL
strSQL (???), "E:\autobackbill\excelrates.xls", True, ""

There's no way that would work right....?

So my options are...
1) run a table query with the strSQL... the str changing based on the
checkboxes
2) have multiple, almost-identical cross tab queries to run. That'd
probably be the most inefficient, time/space consuming route, unless you can
change a queries SQL code through VB... like Queries![GPA 01 Pricing].SQL =
strSQL, then export the query.

I guess that's my question=)


**************
**************

can I change a Query's SQL statement via VB?
ex Queries![GPA 01 Pricing].SQL = strSQL

**************
**************
 
Dim qdfCurr As DAO.QueryDef

Set qdfCurr = CurrentDb.QueryDefs("GPA 01 Pricing")
qdfCurr.SQL = strSQL
 
thanks doug

Douglas J. Steele said:
Dim qdfCurr As DAO.QueryDef

Set qdfCurr = CurrentDb.QueryDefs("GPA 01 Pricing")
qdfCurr.SQL = strSQL

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Kaseano said:
I have to run the cross-tab query that's being exported as a SQL statement
because check boxes on a form are determining which fields are in the
query.

Can I export the SQL statement? I can't imagine how I'd do that...

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel3, DoCmd.RunSQL
strSQL (???), "E:\autobackbill\excelrates.xls", True, ""

There's no way that would work right....?

So my options are...
1) run a table query with the strSQL... the str changing based on the
checkboxes
2) have multiple, almost-identical cross tab queries to run. That'd
probably be the most inefficient, time/space consuming route, unless you
can
change a queries SQL code through VB... like Queries![GPA 01 Pricing].SQL
=
strSQL, then export the query.

I guess that's my question=)


**************
**************

can I change a Query's SQL statement via VB?
ex Queries![GPA 01 Pricing].SQL = strSQL

**************
**************
 
Back
Top