Selecting Record In a SubForm

J

jbeggie

Hey,
Could anyone please help me? I have a subform linked to a main for
Master link is a text field on the main form while child link is
unique column on the subform. The RecordSource of the subform is
query. What I want to do is to populate other unbound textfield
whenever I click on or select a record in the subform.

My query works well. I can get the first record to populate thes
fields but itt sits there and wouldn't move when I select the nex
record in the subform.

Below is the code I use in the "AfterUpdate" event of of the comb
field (Master Link Field).

Private Sub cboFirmID_AfterUpdate()
txtFirmName = cboFirmID.Column(1)



strSQL = "Select * from Brand Where"
strSQL = strSQL & " FirmID=" & Me!cboFirmID.Text
Me!frmBrandSubform.Form.RecordSource = strSQL

'These are the main codes that populate the unbound textfields

txtBrandName = Me!frmBrandSubform.Form![BrandName]
txtBrandID = Me!frmBrandSubform.Form![BrandID]
txtFee = Me!frmBrandSubform.Form![Fee]
txtRegDate = Me!frmBrandSubform.Form![RegDate]
End Su
 
T

tina

so, if i understand you correctly: the unbound text boxes are being
populated with data from a subform record, by code running in the
AfterUpdate event of a control on the main form.

so if you move from one record in the subform to another record in the
subform, do you have any code running in the subform's Current event to
update those unbound text boxes?

hth
 
Top