I wrote a function to return some field values from radio_variant table
it worked fine if i only tried to get rec.Fields("radio_variant_title_tx")
however, it got errors when i tried to do
rec.Fields("radio_variant_id_cd")
rec.Fields("note_tx")
radio_variant_title_tx is a text field that will never be null
radio_variant_id_cd is the primary key of the table
note_tx is a text field that doesn't necessarily have a value
1. so it seems to me that i can't get primary value and null field,
but i believe there must be some way to retrieve the primary key field value and field that might contain null. if so, how?
2. also, what will be the syntax in this case to get values from a lookup column? rec.Fields("[Lookup Column]")?
thank you in advance
Public Function getFields()
Dim rec As Recordset
Set rec = CurrentDb.OpenRecordset("select rv.* " + "from radio_variant rv", Type:=dbOpenDynaset)
Dim output As String
While Not rec.EOF
output = output + rec.Fields("radio_variant_title_tx") + vbTab + rec.Fields("radio_variant_id_cd") + vbCrLf
rec.MoveNext
Wend
MsgBox output, vbInformation, "test"
rec.Close
End Function