Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 25th, 2005, 06:31 AM
Authorized User
 
Join Date: Nov 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default Populate Data in dopdown box

 How do i populate dropdown box on basis of the query written in vb.
i am using access forms.

here is the code
thanks in advance.

Dim abc As String
Dim db As ADODB.connection
Set db = New ADODB.connection
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
'Make Connection with the Database.
connstr = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=CVTracker;Initial Catalog=CVTracker"
db.Open (connstr)
Sql = "Select * From ContactDetails where UserID =" & Form_frmMain.ID
Set rs = db.Execute(Sql)

While Not rs.EOF

-------Some Code Requried here s the code i am missing something in while loop.
how to achieve this.
-----

    rs.MoveNext
Wend


Best Regards,
Vivek.
__________________
Best Regards,
Vivek.
 
Old November 25th, 2005, 08:28 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Why are you using code to populate this combo box?
If the data is in another database, a better solution might be to transfer the data into a temporary table in the local database, and then have the combo box get data from the local table.



mmcdonal
 
Old November 25th, 2005, 08:39 AM
Authorized User
 
Join Date: Nov 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dropdown should display only those dtata which are related to memeber who as logged in.




Best Regards,
Vivek.
 
Old November 25th, 2005, 08:40 AM
Authorized User
 
Join Date: Nov 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by mmcdonal
 Why are you using code to populate this combo box?
If the data is in another database, a better solution might be to transfer the data into a temporary table in the local database, and then have the combo box get data from the local table.



mmcdonal
 dropdown should display only those dtata which are related to memeber who as logged in.



Best Regards,
Vivek.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate a text box from a combo box value dnf999 Access VBA 7 February 6th, 2012 02:24 PM
How to populate drop down box with registery value method Beginning VB 6 2 April 20th, 2006 03:00 AM
Populate a combo box from database w/vbscript morituri VBScript 1 March 1st, 2005 07:06 PM
Populate Combo Box phil.t Access 3 November 18th, 2004 03:39 AM
Populate List Box by Combo Box Selection mmcdonal Access 2 June 15th, 2004 12:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.