I'm using Access 2010 and I'm rusty as heck... So I create a main form and an unbound subform. Unbound to the main form, I should say, but bound to a record source. Things work fine.
In the subform, I have a dropdown called cboGIReqNbr with IDs in it. I also have a textbox called txtGIReqNbr. What's supposed to happen is that when you choose a cboGIReqNbr from the dropdown, txtGIReqNbr is supposed to populate with the description.
I've got this in the AfterUpdate event of cboGIReqNbr:
Dim db As Database
Dim rec As Recordset
Dim sSql As String
Set db = CurrentDb
sSql = "Select GI_Request_Name from tblGIRequest where GI_Request_Nbr = '" & Me.cboGIReqNbr.Text & "'"
Set rec = db.OpenRecordset(sSql)
Me!txtGIReqNbr.SetFocus
Me!txtGIReqNbr.Text = rec(0) <-- PROBLEM
Me.txtLanID = Forms!frmHoursAssigned.cboEmployee.Value
rec(0) does, in fact, populate with the correct text.
The error I get on the problem line is; "This property is read-only and can't be set". None of my objects should be read-only, and all the examples I could find online pointed to people using reserved words (i.e. using "Name" as a field name).
Anyone know how to solve this?