|
-
Mar 23rd, 2006, 02:40 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Bind data to ComboBox in Access form at Run Time ???
hi all,
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 ...
Last edited by nileshhthakur2004; Mar 23rd, 2006 at 02:42 AM.
Reason: Change Hedding of Thread
Nilesh Thakur. 
-
Mar 24th, 2006, 12:27 AM
#2
Re: Bind data to ComboBox in Access form at Run Time ???
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?
-
Mar 24th, 2006, 05:05 AM
#3
Addicted Member
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
-
Mar 30th, 2006, 01:21 AM
#4
Thread Starter
Addicted Member
Re: Bind data to ComboBox in Access form at Run Time ???
hi all,
thanx for your help my problem is get solved
thanx and regards,
Nilesh Thakur. 
-
Mar 30th, 2006, 11:35 PM
#5
Re: [RESOLVED] Bind data to ComboBox in Access form at Run Time ???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|