J
jbruen
How do I concatenate text fields together to make a field name in a table?
Dim MyDB As DAO.Database
Dim MyData As DAO.Recordset
Dim MileTable(50)
' 1 = START
' 2 = MIDDLE
' 3 = END
' ......ETC
Dim MileEvent As String
Dim MileDate As Date
Dim MileUpdDate As Date
Dim MileUser As String
Dim MileNDate As Date
Dim MileNUpdDate As Date
Dim MileNUser As String
Set MyDB = DBEngine.Workspaces(0).Databases(0)
Set MyData = MyDB.OpenRecordset("TabData", DB_OPEN_DYNASET)
With MyData
Do While Not .EOF
For Indx = 1 To MileCnt
BSRNo = !BSR_ID
MileNDate = MileTbl(Indx) & "_DTTM" ' APPEND _DTTM to
table value
MileNUpdDate = MileTbl(Indx) & "_UPD_DTTM" ' APPEND
_UPD_DTTM to table value
MileNUser = MileTbl(Indx) & "_UPD_USR_NAM" ' APPEND
UPD_USR_DTTM to table value
' **************************
' how do I define these next fields to point to the field in
the table
' **************************
MileDate = !{MileNDate} ' START_DTTM
MileNUpdDate = !{MileNUpdDate} ' START_UPD
MileNUser = !{MileUser} '
START_UPD_USR_NAME
Next Indx
.MoveNext
Loop
.Close ' Close table
End With
Exit Function
Dim MyDB As DAO.Database
Dim MyData As DAO.Recordset
Dim MileTable(50)
' 1 = START
' 2 = MIDDLE
' 3 = END
' ......ETC
Dim MileEvent As String
Dim MileDate As Date
Dim MileUpdDate As Date
Dim MileUser As String
Dim MileNDate As Date
Dim MileNUpdDate As Date
Dim MileNUser As String
Set MyDB = DBEngine.Workspaces(0).Databases(0)
Set MyData = MyDB.OpenRecordset("TabData", DB_OPEN_DYNASET)
With MyData
Do While Not .EOF
For Indx = 1 To MileCnt
BSRNo = !BSR_ID
MileNDate = MileTbl(Indx) & "_DTTM" ' APPEND _DTTM to
table value
MileNUpdDate = MileTbl(Indx) & "_UPD_DTTM" ' APPEND
_UPD_DTTM to table value
MileNUser = MileTbl(Indx) & "_UPD_USR_NAM" ' APPEND
UPD_USR_DTTM to table value
' **************************
' how do I define these next fields to point to the field in
the table
' **************************
MileDate = !{MileNDate} ' START_DTTM
MileNUpdDate = !{MileNUpdDate} ' START_UPD
MileNUser = !{MileUser} '
START_UPD_USR_NAME
Next Indx
.MoveNext
Loop
.Close ' Close table
End With
Exit Function