In a Report I'm using DAO to pull some header data from a Company table.
Assigning the value of a field (like Company Name) to the Caption of a label works just fine. But one field is variable text and may need to grow, so I'm using a textbox (txtDescription).
The code below throws an error (You can't assign a value to this object)... the textbox. So how do I set the ControlSource to the field "CoDescription" in the open rowset: rst?
Assigning the value of a field (like Company Name) to the Caption of a label works just fine. But one field is variable text and may need to grow, so I'm using a textbox (txtDescription).
The code below throws an error (You can't assign a value to this object)... the textbox. So how do I set the ControlSource to the field "CoDescription" in the open rowset: rst?
Code:
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblCompanyData")
Me.lblCoName.Caption = rst!Company
Me.txtDescription.Value = rst!CoDescription