MASTER CHILD ERROR

ARW17

Board Regular
Joined
Oct 31, 2016
Messages
109
I made a form with the month in a combo box in the header. There are 2 columns ID (Month Number) and Month (Jan, Feb, etc.). I have column 1 bound. On my subform, I have a field called ENTRY_MO, which has a month number in it as well. I set the Master field as MONTH_COMBO and the Child as ENTRY_MO. When I change the selection in the combo box, my data filters, but when I have selected 2/Feb from the combo box, I'm getting ENTRY_MO = 1 in my subform. This works the whole way through. If I select 12 in the combo box, what filters is month 11. How is this possible?
1605127266304.png
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Is the subform recordsource a table or query? If query, show the sql statement for the form. I don't think the issue is that your date format in regional settings is the cause if you are off by -1 after every combo selection.

Also, there is no AfterUpdate code on the combo, is there? If so, show that too.
 
Upvote 0
Then if the main and subform is bound I'm drawing a blank - unless your ENTRY_MO field is a lookup field in the table.
I don't know if this forum allows you to post a zipped db copy or not because I've never posted a question here but that would certainly help.
BTW, if the combo is just for filtering the subform data it should not be bound to anything.
 
Upvote 0
Instead of using the key as the master, I put a MONTH_NO field in my MONTH table and bound that column, using it as the master. That worked. I don't understand why using the autogenerated key did not, but I'm happy to move on.
 
Upvote 0
Solution
Instead of using the key as the master, I put a MONTH_NO field in my MONTH table and bound that column, using it as the master. That worked. I don't understand why using the autogenerated key did not, but I'm happy to move on.
Good you got it working, but I still wonder...

How was the combobox set up? I believe the entries are indexed starting at 0. So if you're referencing that instead of the displayed value, it would explain your being off by 1 (a selection of 1 is really 0, 2 really 1, etc.).
 
Upvote 0
I thought of that but dismissed it because there's no mention of using ListIndex or Selected properties, just that the bound column is 1. However, now I find this intriguing:
Instead of using the key as the master,
What key? A primary key? If so, perhaps that is off by one. Even that doesn't make a lot of sense to me because the combo has 2 columns with month number and month name. The pic shows the correct number in the combo so for my money, the problem must be what the subform month no field is bound to.
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,387
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top