Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Pipe Size Combo Box
Mark Pierce 
     
4 years ago
I have an issue with a combo box. The combo box pulls from a table with pipe sizes and pipe weights. Each pipe size has a wight and then there is a few pipe sizes that are the same (exp. 7-5/8) however they have different weights.

I am using VBA to update the weight field when you select the pipe size from the combo box. The list in the combo box shows all the pipe sizes and the different weights.  

For the pipe sizes that repeat like the 7-5/8, even when I pick the 7-5/8 with the 29lb line it updates the weight with the first listed 7-5/8 pipe with 39lbs. This happens with any pipe size that has more than one listing.

suggestions? I am sure you will need more info, so please let me know.


thanks,

Mark Pierce
Alex Hedley  @Reply  
           
4 years ago
What's the VBA look like that does the update?
Mark Pierce OP  @Reply  
     
4 years ago
Alex there is the VBA:

  Me.HeatLot = Me.SelectCasingSN.Column(1)
    Me.LotNum = Me.SelectCasingSN.Column(2)
    Me.Size = Me.SelectCasingSN.Column(3)
    Me.Weight = Me.WeightCalc
Kevin Robertson  @Reply  
          
4 years ago
If your controls are on the current form you don't need to specify Me. (most of the time)
Also, watch this video.

Bang V. Dot
Mark Pierce OP  @Reply  
     
4 years ago
thanks Kevin, that was helpful, I updated to the Bang.

However I still have the same issue,

in my query:
Pipesize      Desc               PPF
7-5/8         blahblah           39
7-5/8         blahblah           29

When I select the second line with a PPF of 29, it still populates a PPF of 39 in my form.
It has to due with a repeating 7-5/8 number because any pipe size that is not listed more than once works fine.
Richard Rost  @Reply  
          
4 years ago
Tell me you have a hidden ID field in your combo box / table.
Mark Pierce OP  @Reply  
     
4 years ago

Mark Pierce OP  @Reply  
     
4 years ago
Normally its Hidden but I changed it to visible so I could make sure I was getting the correct lines.
Richard Rost  @Reply  
          
4 years ago
That absolutely should not behave that way. Make a button. Put this in the code:

MsgBox SelectCasingSN

And make sure you see the right ID for the item that's selected in the combo box.
Mark Pierce OP  @Reply  
     
4 years ago

Mark Pierce OP  @Reply  
     
4 years ago
Sorry Richard, I am not following you correctly. I get this error.

I created a button called SelectCasingSN
Kevin Robertson  @Reply  
          
4 years ago
Richard meant for you to message box the value of your combo box from your button.

MsgBox ComboBoxName

FYI: You are trying to message box your button and the error message you received is basically saying that a property or method was expected (For example, SelectCasingSN.Caption)
Mark Pierce OP  @Reply  
     
4 years ago
So just for the heck of it, I created a new query from the same table and same fields and it works without issue!

Richard Rost  @Reply  
          
4 years ago
I was assuming based on your code that you pasted above that SelectCasingSN was the name of your COMBO BOX.

Me.HeatLot = Me.SelectCasingSN.Column(1)

That's what I wanted to see the value of. You've got something spelled wrong or some code in the wrong place somewhere. I don't have enough info to tell you what.
Mark Pierce OP  @Reply  
     
4 years ago
Guys, thanks for helping me trouble shoot this. The end result was it was fixed.

thanks again!

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

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: 5/6/2026 6:43:54 AM. PLT: 1s