| | |
Add Data from Access to Combo Box
![]() |
try this code :
vb Syntax (Toggle Plain Text)
Private Sub Form_Load() Dim RS As ADODB.Recordset Dim Conn As ADODB.Connection Dim Comm As ADODB.Command Dim str As String Set Conn = New ADODB.Connection Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = D:\Only Me\Authors.mdb" Conn.Open Set Comm = New ADODB.Command Set Comm.ActiveConnection = Conn Comm.CommandText = "SELECT Au_ID FROM Authors" Comm.CommandType = adCmdText Set RS = Comm.Execute Do Until RS.EOF = True Combo1.AddItem RS!Au_ID RS.MoveNext Loop Set RS = Nothing Set Comm = Nothing Set Conn = Nothing End Sub
Last edited by Jx_Man; Apr 17th, 2008 at 10:05 pm.
Thanks JX_MAN, I will take that as a compliment. I wonder how many of those solved threads of yours are down to blatantly copying other members replies.
Whereas copying obviously works for some , others benefit from doing a little bit of thinking themselves!!
Hope the code helps with your problem Pranavdv.
Getting to grips with the ADO control is hard work but is a great tool once you get rolling.
Cheers for now
Whereas copying obviously works for some , others benefit from doing a little bit of thinking themselves!!
Hope the code helps with your problem Pranavdv.
Getting to grips with the ADO control is hard work but is a great tool once you get rolling.
Cheers for now
Ther are 10 types of people in the world. Those who do understand binary and those who don't!!
??
hmm...sorry if this code some like yours...
well, i have a book for this.
hmm...sorry if this code some like yours...
well, i have a book for this.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
Similar Threads
- query with combo box input (MS Access and FileMaker Pro)
- add to combo box from access with where statment (Visual Basic 4 / 5 / 6)
- can not update combo box... (VB.NET)
- Reading an Access Database (VB.NET)
- Problem with Form and Combox selections (C#)
- Updating Combo Box (Visual Basic 4 / 5 / 6)
- Hijackthis report, I just don't know (Viruses, Spyware and other Nasties)
- Source Code that don't work? (Java)
- help with hjt and vx2/urllogic (Viruses, Spyware and other Nasties)
- 213.159.117.130 trojan.. help!! (Viruses, Spyware and other Nasties)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: VB6 and mysql problem in filtering dates
- Next Thread: tutorial of VB
Views: 3472 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 7 429 2007 access activex add application array banned basic beep beginner blackjack bmp c++ cd client coffeehouse college component connectionproblemusingvb6usingoledb convert data database datareport date designer desktop dissertations dissertationthesis edit error excel filename form grid group header image inboxinvb installation installer key keypress list listbox listview machine mail match metadata microsoft movingranges nice number object open oracle password pause pdf prime print printer program programmer query random range record refresh registration report reports retrieve save search sites sort sound spectateswamp sql string subroutine table tags textbox time variable vb vb6 vb6.0 vba vista visual visualbasic web windows






