HalloweenWeed
Member
- Local time
- Today, 11:25
- Joined
- Apr 8, 2020
- Messages
- 213
Hi,
I am working on a mass-record maintenance/modification form, within a FE, to enhance old records to add field information and correct the current information on past entries with typos (hundreds of records) for an institution. The main form does not have any associated "source," and all controls are "unbound." It contains two subforms: one that retrieves the person records, and another that retrieves the main records, both are Access standard queries source. The former source is a query of a table, linked to the BE, and the latter subform is sourced via a query of a query of a table of the main records.
Everything works fine until it hits the vba code:
"Can't assign a value to this object"
Odd because the code has already assigned values to other controls on the subform with the same source query at that point. LN_FN is not a calculated field, in either query, it is a field in the source master table, same as the other fields (even same data type, 'short text', 256 length max) that have already had values assigned at that point. When debugging in break mode, I can hover over both input and present values and read them, and they are correct (type 'text' strings) and not long. I have been careful not to name any controls on the main parent form the same as a subform control (thus the "_input" suffix). Basically, what this routine is doing is writing info from the main parent form, unbound controls, to the subform current record. Doing this via vba code from a button on the record list, within the subform "detail" (the code is huge so I will refrain from posting it all unless absolutely needed, I suspect it is not).
At first, with this control within the subform detail panel, I created the control by copying the "LN" field, then modifying it (selecting a different field, and renaming the control same as field, same as I always do). That field that I copied is one of the assignments that is presently working (in vba) before the code gets to this point. The subform is set to the following properties:
Recordset type: Dynaset
Data Entry: No
Allow additions: No (I do not want to be able to add records)
Allow deletions: No
Allow edits: Yes
Allow filters: Yes
Record locks: No locks
Filter on load: No
The control "LN_FN" properties:
Format:
Visible: Yes
Control source: LN_FN
Text format: Plain text
Input mask:
Default value:
Validation rule:
Filter lookup: Database default
Enabled: Yes (have tried no)
Locked: No (have tried yes)
This control was the last control added by the way.
What troubleshooting I have already done:
Checked the queries carefully for multiples of the same field, calculated field, and source. The thing is, there is not even any conditionals on these fields in either query, and it is a field in the linked table, same table that other forms routinely modify (even the same field). I have tried renaming the control, same result. I have checked both the parent form and it's other subform for the same control name/field, the other subform had the same field and field name, so I tried renaming both the field and control on the other subform and other source query, just in case that was causing an issue, no joy.
I can open the source query (with the forms open, they are needed for parameters of the query and LN_FN is not one of those), and manually modify LN_FN there! This would mean that the problem does not reside in the underlying query, correct?
Edit: FYI there are no comboboxes on any of these forms.
I would appreciate any ideas you may have. Thank you.
I am working on a mass-record maintenance/modification form, within a FE, to enhance old records to add field information and correct the current information on past entries with typos (hundreds of records) for an institution. The main form does not have any associated "source," and all controls are "unbound." It contains two subforms: one that retrieves the person records, and another that retrieves the main records, both are Access standard queries source. The former source is a query of a table, linked to the BE, and the latter subform is sourced via a query of a query of a table of the main records.
Everything works fine until it hits the vba code:
Code:
LN_FN = Me.Parent![LN_FN_input]
"Can't assign a value to this object"
Odd because the code has already assigned values to other controls on the subform with the same source query at that point. LN_FN is not a calculated field, in either query, it is a field in the source master table, same as the other fields (even same data type, 'short text', 256 length max) that have already had values assigned at that point. When debugging in break mode, I can hover over both input and present values and read them, and they are correct (type 'text' strings) and not long. I have been careful not to name any controls on the main parent form the same as a subform control (thus the "_input" suffix). Basically, what this routine is doing is writing info from the main parent form, unbound controls, to the subform current record. Doing this via vba code from a button on the record list, within the subform "detail" (the code is huge so I will refrain from posting it all unless absolutely needed, I suspect it is not).
At first, with this control within the subform detail panel, I created the control by copying the "LN" field, then modifying it (selecting a different field, and renaming the control same as field, same as I always do). That field that I copied is one of the assignments that is presently working (in vba) before the code gets to this point. The subform is set to the following properties:
Recordset type: Dynaset
Data Entry: No
Allow additions: No (I do not want to be able to add records)
Allow deletions: No
Allow edits: Yes
Allow filters: Yes
Record locks: No locks
Filter on load: No
The control "LN_FN" properties:
Format:
Visible: Yes
Control source: LN_FN
Text format: Plain text
Input mask:
Default value:
Validation rule:
Filter lookup: Database default
Enabled: Yes (have tried no)
Locked: No (have tried yes)
This control was the last control added by the way.
What troubleshooting I have already done:
Checked the queries carefully for multiples of the same field, calculated field, and source. The thing is, there is not even any conditionals on these fields in either query, and it is a field in the linked table, same table that other forms routinely modify (even the same field). I have tried renaming the control, same result. I have checked both the parent form and it's other subform for the same control name/field, the other subform had the same field and field name, so I tried renaming both the field and control on the other subform and other source query, just in case that was causing an issue, no joy.
I can open the source query (with the forms open, they are needed for parameters of the query and LN_FN is not one of those), and manually modify LN_FN there! This would mean that the problem does not reside in the underlying query, correct?
Edit: FYI there are no comboboxes on any of these forms.
I would appreciate any ideas you may have. Thank you.
Last edited: