Fieldname prefix in query yields both prefixed and unprefixed fieldnames

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
 
J

John Spencer

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
..
 
J

John Spencer

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
..
 
Top