M
Mark Kubicki
[this code, out of context, will seem irrational alluding to poorly design
data base... don't be concerned, as used, it's not so absurd]
I have 2 tables with identical fields,
tbl... has multiple records
tbe... has only one record
cboPresetOption is a combo box on the current form
I am trying to simply display a list that compares the equivalent values in
the 2 tables
later, I will assign the values of the selected record in the tbl table to
the single record in the tbe table
the result I get is:
the field name (correct), its value in the tbl table (correct), and text:
which reads something like this: rstTBE.field.name.value (incorrect - it
should be the actual value of the field)
Any thoughts would be appreciated
thanks inadvance,
mark
---------------------------------------------------------------
Private Sub cboPresetOption_Change()
Set Db = CurrentDb()
Dim rstTBL As DAO.Recordset
Dim rstTBE As DAO.Recordset
Dim fld As DAO.Field
Set rstTBL = Db.OpenRecordset("SELECT * FROM
[tblFixtureSchedulePrintOptions] where [PresetOption] = " &
Me.cboPresetOption)
Set rstTBE = Db.OpenRecordset("SELECT * FROM
[tbeFixtureSchedulePrintOptions]")
VStr = ""
With rstTBL
For Each fld In .Fields
TBLvalue = fld.Value
TBEvalue = "rstTBE." & fld.Name & ".Value"
VStr = VStr & fld.Name & " - " & TBLvalue & " ~ " & TBEValue &
Chr(10) & Chr(13)
Next fld
End With
msgbox Vstr
data base... don't be concerned, as used, it's not so absurd]
I have 2 tables with identical fields,
tbl... has multiple records
tbe... has only one record
cboPresetOption is a combo box on the current form
I am trying to simply display a list that compares the equivalent values in
the 2 tables
later, I will assign the values of the selected record in the tbl table to
the single record in the tbe table
the result I get is:
the field name (correct), its value in the tbl table (correct), and text:
which reads something like this: rstTBE.field.name.value (incorrect - it
should be the actual value of the field)
Any thoughts would be appreciated
thanks inadvance,
mark
---------------------------------------------------------------
Private Sub cboPresetOption_Change()
Set Db = CurrentDb()
Dim rstTBL As DAO.Recordset
Dim rstTBE As DAO.Recordset
Dim fld As DAO.Field
Set rstTBL = Db.OpenRecordset("SELECT * FROM
[tblFixtureSchedulePrintOptions] where [PresetOption] = " &
Me.cboPresetOption)
Set rstTBE = Db.OpenRecordset("SELECT * FROM
[tbeFixtureSchedulePrintOptions]")
VStr = ""
With rstTBL
For Each fld In .Fields
TBLvalue = fld.Value
TBEvalue = "rstTBE." & fld.Name & ".Value"
VStr = VStr & fld.Name & " - " & TBLvalue & " ~ " & TBEValue &
Chr(10) & Chr(13)
Next fld
End With
msgbox Vstr