Composite key combo box problem

gh444

New member
Local time
Today, 11:05
Joined
Dec 6, 2014
Messages
8
Hi, I have a main form with the composite key:
Machine_ID (Text selected from a combo box)
Shift_date (Using calendar control)
Shift_start_hour (Text selected from a combo box)

I have a sub-form with the composite key:
Machine_ID
Shift_date
Shift_start_hour
batch_no (Free text entry)

I create my first record with entries on the main form and sub-form

When I click the new record button on the main form record selector it clears everything as expected and presents a new blank record.

The problem occurs when I start to populate the main form to create the new record. After populating:
Machine_ID (Text selected from a combo box)
Shift_date (Using calendar control)
The sub-form record is populated with the entry from the first record before I can select from the start_time_hour combo box.

I don't understand why the sub-form is populating early. Is it something to do with using combo boxes to create my composite key?

When I substitute the combo boxes for text fields I have no problem.

Any help much appreciated.
 
When a new mainform primary key is generated, the subform tumbles to the correct related record, assuming that the sub and main are properly related. Data in the sub and parent can be populated in any order, so long as the parent and sub are properly related.
 
Must have been that my forms were not properly related. I've rebuilt them and everything seems okay.
Got it into my head that it was an issue with combo boxes. Thanks for steering me away from that. Your reply much appreciated.
 
It's great that you figured it out. Kuddos. :)
 

Users who are viewing this thread

Back
Top Bottom