473,397 Members | 2,077 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,397 software developers and data experts.

How to traverse a record in a row source property of a component

syedshaffee
Hey people,
Expand|Select|Wrap|Line Numbers
  1.  
  2. How Can I Traverse Through a row source Property of a component
  3.  
is their any way to do the same? if yes please help
Sep 5 '12 #1

✓ answered by TheSmileyCoder

This code loops through a combobox (cmb_SelectSubSystem) on my form, printing the second column:
Expand|Select|Wrap|Line Numbers
  1. Private Sub btn_Traverse_Click()
  2.    Dim rs As DAO.Recordset
  3.    Set rs = Me.cmb_SelectSubSystem.Recordset
  4.    Dim strCombined As String
  5.    rs.MoveFirst
  6.    Do While Not rs.EOF
  7.       strCombined = strCombined & "," & rs.Fields(1)
  8.       rs.MoveNext
  9.    Loop
  10.    Set rs = Nothing
  11.    MsgBox strCombined
  12. End Sub
I dont really know if this could have any direct effect on the form itself, and what is selected in the combobox, but I dont think so.

4 1795
TheSmileyCoder
2,322 Expert Mod 2GB
You need to be more specific, which components are we talking about?

A combobox has .Recordset property, I suppose you could take a look at that.
Sep 5 '12 #2
i have a dropdown list and i want to traverse through that is it possible
Sep 5 '12 #3
TheSmileyCoder
2,322 Expert Mod 2GB
Probably, what are you looking for, what do you want to achieve?

Do you want to loop through all the records doing something, or looping through looking for something? I can't guess your requirements, and you are being extremely vague.
Sep 5 '12 #4
TheSmileyCoder
2,322 Expert Mod 2GB
This code loops through a combobox (cmb_SelectSubSystem) on my form, printing the second column:
Expand|Select|Wrap|Line Numbers
  1. Private Sub btn_Traverse_Click()
  2.    Dim rs As DAO.Recordset
  3.    Set rs = Me.cmb_SelectSubSystem.Recordset
  4.    Dim strCombined As String
  5.    rs.MoveFirst
  6.    Do While Not rs.EOF
  7.       strCombined = strCombined & "," & rs.Fields(1)
  8.       rs.MoveNext
  9.    Loop
  10.    Set rs = Nothing
  11.    MsgBox strCombined
  12. End Sub
I dont really know if this could have any direct effect on the form itself, and what is selected in the combobox, but I dont think so.
Sep 5 '12 #5

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

Similar topics

4
by: Dustin Wilson | last post by:
With the code listed below I can get a list of all the forms within my database. Is there a way to also get the Record Source property from each of these forms? How is this done? Thanks...
3
by: eddiec | last post by:
hi everyone, I have a report in an adp that uses aggregate functions in its record source and I am trying to figure out how to filter the records displayed in the report: DoCmd.OpenReport...
2
by: Lyn | last post by:
If I have a form where the RecordSource property is set to the name of a table, then on opening the SingleForm form I can cycle through all the records in the table one at a time via Next and...
1
by: paul.hanti | last post by:
I have a main form (form2) that contains a subform (frmQueryArea). The subform contains the results of a query built by selecting criteria on the main form and pushing a command button. Is...
4
by: steph | last post by:
Hi, A question regarding Access 2002: I've got a form which should be displayed in Form View and in Datasheet View. But I want to use a different record source for each view. That means, when...
6
by: ApexData | last post by:
I have 2 tables: Table1 and Table2. Neither one has a primary key because each table will only have 1-record. My form is a SingleForm unbound with tabs (my desire here). Using this form, in...
3
by: John | last post by:
Hi I Saved As... a form to another name and change the new forms data source. The problem is that the new form does not show any data with the new data source. I have tried compact & repair...
1
by: Peter Herath | last post by:
I have created a report using sample codes taken by the forum. one problem is that the report displays the field/column names in the table in columnar format(field names display in rows.) but i want...
1
by: rzito | last post by:
I have an ADP frontend with a sql back-end, when I set the record sources for some of my list boxes with code it could take up to 45 seconds for the list to populate. Is there a way I can trigger ...
3
vavc1980
by: vavc1980 | last post by:
Hello all, Is there any way to export to a text file the Record Source (or any other property value) of a form or report? Currently I'm able to export the code in the modules and the code of...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.