Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Recordsets
Anne Cowden 
     
4 hours ago
Is it possible to reference a column in a combobox within a recordset loop.
A Toykan  @Reply  
       
4 hours ago
Yes, it is possible, but in a loop you need to make difference between your recordset and the combobox itself. So here are your options:
1. How to reference combobox columns
In Access, columns are zero-based, so you can referenc them like that:
Me!MyCombo.Column(0) 'First column
Me!MyCombo.Column(1) 'Second column
and so on. And this works regardless if you are inside the loop or not, provided that MyCombo is bound to the recordset.
Now, if you are looping through recordset:

Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
Do While Not rs.EOF
'Move form to current record
Me.Bookmark = rs.Bookmark

'Access ComboBox column
Debug.Print Me!MyCombo.Column(1)

rs.MoveNext
Loop

Inside the loop you set the form's bookmark to the current record and then you can reference combobox columns as explained above. Also beware of these:
Value property of the combobox will always give you the bound column, so if you need other columns, you have to use the syntax above. Also make sure that ColumnCount of the combobox is set correctly so that the column that you want to reference actually exists. But regardless of other settings, the syntax remains the same. And it works whether your combobox is bound to a table/query or to a value list.
Anne Cowden OP  @Reply  
     
3 hours ago
Many thanks A for your speedy reply, I have been struggling with this for a few days. Our customers are charged different rates for each trade. But sometimes a roofer, for example will help a groundsman and the customer will be charged for 2 groundsmen. I have set up a trade combo box in the labour form which allows the user to choose a trade.

My material form has a field named description which details the items used. My labour form also has a field named description which I want to display the trade. My record set uploads the materials to the Invoice Detail table perfectly and the labour form uploads the number of hours and the hourly rate but leaves the description field blank. In Richard's Work Order Seminar video he totals the hours but I want to list them separately in the Invoice Detail Table. Is there a better way to do this other than referencing the combo box?


Add a Reply Upload an Image
Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/5/2026 5:08:12 PM. PLT: 0s