473,383 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Open RecordSet...

17
Hi All,
May i know How to open a RecordSet For the combobox?
My Original Code as follows

Expand|Select|Wrap|Line Numbers
  1. Dim conn As New ADODB.Connection
  2. Dim objMyRecordset As New ADODB.Recordset
  3.  
  4. Dim strSQL As String
  5.  
  6. Set conn = New ADODB.Connection
  7. conn.ConnectionString = "Provider = SQLOLEDB; Data Source=SDSACCOUNT; Initial Catalog= SSPLCO; user ID=sa; Password=sa;"
  8. conn.Open
  9. 'Do your query
  10.  
  11. strSQL = "Select ITEMNO FROM ICITEM;"
  12.  
  13. Set objMyRecordset.ActiveConnection = conn
  14. objMyRecordset.Open strSQL
  15. Me.Combo4.RowSourceType = "Table/Query"

After i use this code nothing comeout on my combobox...

Thanks in advance!!!
Apr 9 '15 #1
3 1287
zmbd
5,501 Expert Mod 4TB
I don't see where you actually set the rowsource for the combobox
Apr 9 '15 #2
Anbusds
17
Can You Give me Correct Code that matching with the above?
Any sample...
Apr 9 '15 #3
zmbd
5,501 Expert Mod 4TB
Line 11 in your posted code.
Set that variable as your recordsource for the combobox after line 15

You might be interested in reviewing the cascading combo/filter article(s) as they cover this and much more.

Don't worry if you don't follow all of the coding in the articles, just start a new thread with any questions and link back to the article in question.

I'll just post the grouping I have on filtering... but the combobox articles are better match to topic.
-filtering-
Apr 9 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: kgs | last post by:
Problem exists on ms-access, ms-sqlserver using ADO (not in ODBC), visual Basic, C#, and VB.NET. Somethimes when I open second recordset in this same connection that first, it has EOF, but I know,...
4
by: Dalan | last post by:
I presume that using an open recordset method is the preferred method of accomplishing what I'm trying to do. Of course, if there are other options that would work, feel free to share them. I...
2
by: Colleyville Alan | last post by:
I ran into problems in an app in which I received a msg of "cannot lock the table, it is in use by another user". It turns out that I had opened a recordset with a command like set rstmyrecs =...
2
by: Sunil Korah | last post by:
I am having some trouble with opening recordsets. I have used code more or less straight from the access help. But still I am getting some errors. I am unable to work out what exactly I am doing...
12
by: (Pete Cresswell) | last post by:
Say I've got a RecordSet: ----------------------------------------------------------- Set myRS = CurrentDB.OpenRecordset(SomeSQL, dbOpenDynaset)...
0
by: solar | last post by:
I am creating a new recordset in 2 tables, orders and order details.Obviously i have to open the recordset for two tables.Shall i open the recordset for the table order details and when shall i...
2
by: kifaro | last post by:
Hi I am opening recordsets in my asp page with the following command: rs.open mysql,cn,3,3 on occasion it isn't working and I have to do: set rs=cn.execute(mysql) Any clue why?? Regards,...
2
by: Kosmos | last post by:
I am opening the following connections as such although I am only referring to the first connection for this question: Dim con1 As ADODB.Connection Dim con2 As ADODB.Connection Dim recSet1 As...
2
by: banderson | last post by:
Hello Bytes, I am having trouble copying a value from an open record in a recordset into a form. I have a form frmOutreachReferral that is filled in after a Site Visit has been performed and it...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.