473,387 Members | 1,579 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,387 software developers and data experts.

Cascading combo box doesn't change with record set

I have a set of cascading combo boxes. The first (IDH) is based on a query. Then, I have the following code to change the second combo box.
Expand|Select|Wrap|Line Numbers
  1. Private Sub IDH_AfterUpdate()
  2. Dim strSource As String
  3.  
  4. strSource = "SELECT Supplier " & _
  5.                    "FROM tblMaterialSuppliers " & _
  6.                    "WHERE IDH = '" & Me.IDH & "' ORDER BY Supplier"
  7. Me.Supplier.RowSource = strSource
  8. Me.Supplier = vbNullString
  9. End Sub
This works as long as I stay on the same record, but when I change records the selection in the second combo box doesn't update.
Oct 14 '14 #1

✓ answered by Pookaroo85

The combobox value is blank. It saves into the table, but then doesn't reappear when toggling records in the form. I removed "Me.Supplier = vbNullString".

5 1785
Rabbit
12,516 Expert Mod 8TB
That's because when you change records, you're not updating the table data, so the code isn't going to run. Call the code as well in the form's Current event, that fires whenever you change records.
Oct 14 '14 #2
I added the same code (copy/paste) to the form's on current event and now when I toggle records, the combo box is blank.
Oct 14 '14 #3
Rabbit
12,516 Expert Mod 8TB
The combobox value is blank or the combobox list is blank? The combobox value should be blank, you set it to null in your code. The combobox list shouldn't be blank assuming the record you're going to has a value in IDH.
Oct 14 '14 #4
The combobox value is blank. It saves into the table, but then doesn't reappear when toggling records in the form. I removed "Me.Supplier = vbNullString".
Oct 15 '14 #5
Figured it out. Thank you!
Oct 15 '14 #6

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

Similar topics

9
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
26
by: pouj | last post by:
Hey i need help with setting up this on ACCESS 2007 i need step by step i need a form... i select a name (drop list)...then gives me more choice (in next drop list) ....then when i select that...
3
klarae99
by: klarae99 | last post by:
Hello, I am using Access 2003 to design an inventory database. Please be pacient with this question, I am not sure how exactly to explain what is happening concisely but I will do my best. I...
3
kcdoell
by: kcdoell | last post by:
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box: Private Sub CboDivision_AfterUpdate() 'When the Division is selected, the appropriate Segment...
7
by: Toireasa | last post by:
Hi, Newbie Access developer here, and my first post on this forum, so I might not get everything right - thanks in advance for your help and your patience! I'm using Access 2007, in XP. I'm...
20
by: luciegiles | last post by:
Hi, I have used the tutorial Cascading Combo/List Boxes to filter the combo box cboCareManager dependent on the entry to cboLocalityTeam - the common code between the two tables is LocalityCode. ...
3
by: MOCaseA | last post by:
I have a record lookup form that has several combo box filters set up. However I noticed a slight problem. The filters are working correctly, but there are now over 2000 entries and when filtering...
2
by: ncsthbell | last post by:
I am using MS Access 2007. I have a form that has two combo boxes, one for divisions, the other for groups. I am trying to create ‘cascading’ boxes that will allow a division to be selected and...
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: 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: 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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.