gary.newport
Registered User.
- Local time
- Today, 09:21
- Joined
- Oct 14, 2009
- Messages
- 79
I have a form which contains a subform. This form is purely for new records and so is set to only allow Additions as well as having Data Entry set to Yes.
Embedded in this form is a subform; which is also set to Additions and Data Entry (though I have tried Additions and Edits without Data Entry).
The form itself works fine but the subform does not offer the new record field for anyone to select from; therefore no new records in the subform can be created.
Why not?
********* Update *********
Okay, I realise that it is down to Data Entry and that there is, on opening the form, no value within the primary field (obviously until the form starts to be completed). Where an existing value exists then the subform works (but no value can exist for a new record).
I am assuming that once someone selects a value within one of the fields and therefore the system generates a primary key value within the form, I will need to use VBA connected to the On Change of the primary key field that will create a new record within the subform, updating the subform to offer the fields for a new record to be entered.
Am I correct in my thinking and if so, any idea what the code would look like?
***** UPDATE 2 *****
If I run the form via the switchboard everything works fine; if I run the form directly then I have an issue (switchboard is set to run form in ADD mode). No idea why.
Embedded in this form is a subform; which is also set to Additions and Data Entry (though I have tried Additions and Edits without Data Entry).
The form itself works fine but the subform does not offer the new record field for anyone to select from; therefore no new records in the subform can be created.
Why not?
********* Update *********
Okay, I realise that it is down to Data Entry and that there is, on opening the form, no value within the primary field (obviously until the form starts to be completed). Where an existing value exists then the subform works (but no value can exist for a new record).
I am assuming that once someone selects a value within one of the fields and therefore the system generates a primary key value within the form, I will need to use VBA connected to the On Change of the primary key field that will create a new record within the subform, updating the subform to offer the fields for a new record to be entered.
Am I correct in my thinking and if so, any idea what the code would look like?
***** UPDATE 2 *****
If I run the form via the switchboard everything works fine; if I run the form directly then I have an issue (switchboard is set to run form in ADD mode). No idea why.
Last edited: