[RESOLVED] Bind data to ComboBox in Access form at Run Time ???
hi all, :bigyello:
i have one from on which i have number of control i have one Combobox CustomerName on my form when user select "customername" the data related to that customer is display in all control now i have one more combobox on same form i want to bind the data to this 2 nd combobox how can i do this ??
How can i write the binddata property of combobox through code at runtime ??
suppose code is like this ....
is this posible ???
select pricecode from price where customerid = "& combobox1.value &"
if rs.BOF = false And rs.EOF = false then
while rs.EOF
combobox2.additem(rs("pricecode "))
wend
Endif
the code which i write is just an example, is this posible ?? How ??
additem method is not present there ....
pls help me regarding this ...
Re: Bind data to ComboBox in Access form at Run Time ???
Quote:
i have one from on which i have number of control i have one Combobox CustomerName on my form when user select "customername" the data related to that customer is display in all control now i have one more combobox on same form i want to bind the data to this 2 nd combobox how can i do this ??
How can i write the binddata property of combobox through code at runtime ??
Hi,
Based on my understanding, your requirement is you have a form with 2 combo boxes..when you select a customer name combo box, the second combo box will display the records corresponding to the customer name...Am I right?
Where does binding takes place on this?
:) :) :)
Re: Bind data to ComboBox in Access form at Run Time ???
Here's some code I use to update the source of a combo based on another combo
Code:
Private Sub combobox1_AfterUpdate()
On Error GoTo errhandler
combobox2=""
If combobox1<> "" Then
combobox2.RowSource = "select pricecode from price where customerid=" & CLng(combobox1)
Else
combobox2.RowSource = "select pricecode from price"
End If
combobox2.Requery
SysCmd acSysCmdClearStatus
Exit Sub
errhandler:
SysCmd acSysCmdSetStatus, Err.Description
End Sub
Re: Bind data to ComboBox in Access form at Run Time ???
hi all, :bigyello:
thanx for your help my problem is get solved
thanx and regards,
Re: [RESOLVED] Bind data to ComboBox in Access form at Run Time ???
Hi,
Good work...
:) :) :)