Access wants an entry for a nonexistent field

hilian

Episodic User
Local time
Yesterday, 19:16
Joined
May 17, 2012
Messages
130
I made one modification to my db. I removed a text box, txt4_mh_10, from a subform, frmMH. I also removed the control source in the table, tblMH, 4_mh_10. There was also a line of code that changed the visible property for the text box depending on the answer to a previous control, and I removed that. Now, when I try to load the subform, I get the message “Enter parameter tblMH.4_mh_10.” I checked, and the field is gone, as is the text box and the line of code that references it.

Any idea how to fix this?

Thanks,

Henry
 
Check the row sources of combos or listboxes, which might still reference the deleted field. Also check the LinkMasterFields and LinkChildFields properties of any subform controls.
 
Also check the Filter and Sort Properties of the Form. They stick if the form is saved with them implemented.
 
For that matter, the recordsource for the (sub-)form, if it was created by a wizard, might have an explicit SQL query stored in the Form.Recordsource property rather than the name of a query. If the form had used an external query as-is, this wouldn't be the case, but the wizards WILL store SQL sometimes.
 
It does have an explicit SQL query stored in the record source property. I deleted tblMH.4_mh_10 from the query. Now it wants an entry for tblMH.ID.

Is it better to delete and reconstruct the subform. It only has 11 controls, or can I substitute the SQL statement with the actual table name?
 
Last edited:
Now it wants an entry for tblMH.ID.

Check for the circumstance described in post 21 of this thread.


Is it better to delete and reconstruct the subform. It only has 11 controls, or can I substitute the SQL statement with the actual table name?

Should not be necessary to rebuild the form. Just find the reference if it isn't what I mentioned above.

BTW A useful tool for finding references to things anywhere in the project is V-tools Total Deep Search. Overkill in this case but something every developer should have.
 
Thanks to everybody who replied. I checked the row sources, as MarKK suggested. Nothing! Then I replaced the SQL statement with the name of the table. Now the form loads and seems to be working as intended. I will still look at the thread Glaxiom supplied the link for.

Cheers,

Henry
 

Users who are viewing this thread

Back
Top Bottom