Fieldname prefix in query yields both prefixed and unprefixed fieldnames

  • Thread starter Thread starter kandersbjork
  • Start date Start date
K

kandersbjork

I have a problem a query in Access 2003 yields both fieldnames thats
are both prefixed and unprefixed. Is there are setting that make all
fields prefixed?

BR
anders
 
I am not aware of any setting that would do this.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
You can't do this with a query, but here is some VBA code that you could
use.

Public Function fListTableInfo(pTable As String) As Boolean
On Error GoTo Err_fListTableInfo
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim i As Integer

Set db = CurrentDb
Set tdf = db.TableDefs(pTable)

Debug.Print "Table: " & pTable
Debug.Print "----------------------------"

For i = 0 To tdf.Fields.Count - 1

Set fld = tdf.Fields(i)
Debug.Print "Field: " & fld.Name

Next i
Debug.Print "----------------------------"

db.Close

Exit_fListTableInfo:
Set fld = Nothing
Set tdf = Nothing
Set db = Nothing
Exit Function

Err_fListTableInfo:
MsgBox Err.Description
Resume Exit_fListTableInfo
End Function



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top