S
sam
Hi,
I have an unbound form with a number of combo's. I'm wanting to select from
the combo and populate a number of text boxes. I know I can do it just by
putting a control source in the text box of =cboDem.column(2) but am trying
to work out how to do it with code. I've tried many different ways and just
can't do it. I think I probably need 'find' in there somewhere... I'm
completely lost now. can anyone assist?
Private Sub cboDemo_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT tblDemo.DemoIDS,
tblClient.Client, tblStoreDetail.ClientNm, tblStoreDetail.StoreNo FROM
(tblDemo LEFT JOIN tblClient ON tblDemo.ClientID = tblClient.ClentIDS) LEFT
JOIN tblStoreDetail ON tblDemo.StoreID = tblStoreDetail.StoreIDS WHERE
(((tblDemo.DemoIDS)=[Forms]![tblScheduling]![cboDemo]));")
With rs
Me.txttest = !StoreNo
End With
'clean up
rs.Close
Set rs = Nothing
End Sub
I have an unbound form with a number of combo's. I'm wanting to select from
the combo and populate a number of text boxes. I know I can do it just by
putting a control source in the text box of =cboDem.column(2) but am trying
to work out how to do it with code. I've tried many different ways and just
can't do it. I think I probably need 'find' in there somewhere... I'm
completely lost now. can anyone assist?
Private Sub cboDemo_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT tblDemo.DemoIDS,
tblClient.Client, tblStoreDetail.ClientNm, tblStoreDetail.StoreNo FROM
(tblDemo LEFT JOIN tblClient ON tblDemo.ClientID = tblClient.ClentIDS) LEFT
JOIN tblStoreDetail ON tblDemo.StoreID = tblStoreDetail.StoreIDS WHERE
(((tblDemo.DemoIDS)=[Forms]![tblScheduling]![cboDemo]));")
With rs
Me.txttest = !StoreNo
End With
'clean up
rs.Close
Set rs = Nothing
End Sub