Function GetFields(pStr As String) As String
Dim db As Database
Dim fld As Field
Dim tdf As TableDef
Dim strSql As String
Set db = CurrentDb
Set tdf = db.TableDefs(pStr)
strSql = ""
For Each fld In tdf.Fields
strSql = strSql & fld.Name & "--" & Choose(fld.Type, "Boolean", "Byte", "Integer", "Long", "Currency", "Single", "Double", "Date", "Binary", "Text", "LongBinary", "Memo", , , "GUID") & "; "
Next fld
GetFields = Left(strSql, Len(Trim(strSql)) - 1)
End Function