Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. exlude from column ordering a field

exlude from column ordering a field

Scheduled Pinned Locked Moved Visual Basic
databasecomtutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sal21
    wrote on last edited by
    #1

    I have maked this code and it work nice, for me;-) Now i want to exclude fronm column ordering the filed named "DATA_AGG" how to? here the mdb in access:www.mytempdir.com/1323897 Option Explicit Sub ORDER_FILEDS() Dim DATABASE As DAO.DATABASE Dim TABELLA As DAO.TableDef Dim CAMPO_TEMP As DAO.Field Dim POSIZIONE() As Integer Dim CAMPO_NOME() As String Dim INT_TEMP As Integer Set DATABASE = OpenDatabase("\\GCD01F4500\DATI\PUBBLICA\ANTIRIC\OPERATORI.MDB") Set TABELLA = DATABASE.TableDefs("TEST") With TABELLA ReDim POSIZIONE(0 To .Fields.Count - 1) As Integer ReDim CAMPO_NOME(0 To .Fields.Count - 1) As String For INT_TEMP = 0 To .Fields.Count - 1 POSIZIONE(INT_TEMP) = .Fields(INT_TEMP).OrdinalPosition CAMPO_NOME(INT_TEMP) = .Fields(INT_TEMP).Name Next INT_TEMP For Each CAMPO_TEMP In .Fields CAMPO_TEMP.OrdinalPosition = 1 Next CAMPO_TEMP End With DATABASE.Close End Sub

    N 1 Reply Last reply
    0
    • S sal21

      I have maked this code and it work nice, for me;-) Now i want to exclude fronm column ordering the filed named "DATA_AGG" how to? here the mdb in access:www.mytempdir.com/1323897 Option Explicit Sub ORDER_FILEDS() Dim DATABASE As DAO.DATABASE Dim TABELLA As DAO.TableDef Dim CAMPO_TEMP As DAO.Field Dim POSIZIONE() As Integer Dim CAMPO_NOME() As String Dim INT_TEMP As Integer Set DATABASE = OpenDatabase("\\GCD01F4500\DATI\PUBBLICA\ANTIRIC\OPERATORI.MDB") Set TABELLA = DATABASE.TableDefs("TEST") With TABELLA ReDim POSIZIONE(0 To .Fields.Count - 1) As Integer ReDim CAMPO_NOME(0 To .Fields.Count - 1) As String For INT_TEMP = 0 To .Fields.Count - 1 POSIZIONE(INT_TEMP) = .Fields(INT_TEMP).OrdinalPosition CAMPO_NOME(INT_TEMP) = .Fields(INT_TEMP).Name Next INT_TEMP For Each CAMPO_TEMP In .Fields CAMPO_TEMP.OrdinalPosition = 1 Next CAMPO_TEMP End With DATABASE.Close End Sub

      N Offline
      N Offline
      nlarson11
      wrote on last edited by
      #2

      because you are no longer dealing with a 1 to 1, you need to use a different varaible for the posizione and camp_nome. dim INT_ACC as integer = 0 For INT_TEMP = 0 To .Fields.Count - 1 If .Fields(INT_TEMP).Name <> "DATA_AGG" Then POSIZIONE(INT_ACC) = .Fields(INT_TEMP).OrdinalPosition CAMPO_NOME(INT_ACC) = .Fields(INT_TEMP).Name INT_ACC = INT_ACC + 1 End If Next INT_TEMP

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups