Notiophilus
Registered User.
- Local time
- Today, 02:40
- Joined
- Jan 18, 2015
- Messages
- 42
I use fields in the (hidden) footer of a single form to handle validation checks. Recently I needed to include a bound subform, and discovered that
*note: I am very much an amateur so mayyyybe the explanation is beyond my ken. Still, I'm curious.
The table structure has a 1-1 relationship. Each story may have up to one optional comment.
tblStory: StoryID (PK), [other fields]
tblStoryComments: StoryID (FK), Comment
tblStory is the main form controlsource; the bound subform shows tblStoryComments. I use an unbound field to view and edit comments, and only commit the edits (with the hidden bound subform) once the entire form saves. Before saving, the form runs validation checks: if key fields are not filled in, the user is alerted and the save is cancelled.
- if the subform is placed in the hidden footer, VBA cannot reference it:
error 2455, "You entered an expression that has an invalid reference to the property Form/Report."
- if the subform is placed in the footer, but the footer is visible, there are no errors
- if the subform is hidden, but in the main body of the form, there are no errors
*note: I am very much an amateur so mayyyybe the explanation is beyond my ken. Still, I'm curious.
The table structure has a 1-1 relationship. Each story may have up to one optional comment.
tblStory: StoryID (PK), [other fields]
tblStoryComments: StoryID (FK), Comment
tblStory is the main form controlsource; the bound subform shows tblStoryComments. I use an unbound field to view and edit comments, and only commit the edits (with the hidden bound subform) once the entire form saves. Before saving, the form runs validation checks: if key fields are not filled in, the user is alerted and the save is cancelled.