V
Van T. Dinh
See comments in-line.
HTH
Van T. Dinh
MVP (Access)
Me.SubformCONTROL.Visible = True
should do.
However, the critical question is why do you set up a One-
to-Many relationship and use the Form / Subform
combination (which is designed especially for the One-to-
Many relationship) but you actually want (more or less) a
One-to-One relationship???
accurate, if you use a Form as the SourceObject of the
Subform Control). You can simply set the "Navigation
Buttons" Property of this Form (the SourceObject) to False.
Dummy Record doesn't have useful data and more often than
not create problems later. Dummy Records are never
necessary if you use Access correctly. I am yet to use
dummy Records in any database (and I have done quite a
few, some got more than 100 Tables).
It is probably related to the problem of using One-to-Many
relationship while you really want One-to-(at most)One
relationship.
name of the Table in your case. You can only see the name
of the Subform*CONTROL* in the DesignView of the Main Form.
Note that you are using the DatasheetView of the Table and
NOT a Form as the SourceObject. In this case, you canNOT
turn off the Navigation Buttons of the Subform.
saves the Design of the current data object, i.e. your
Form in this case. You actually need:
DoCmd.RunCommand acCmdSaveRecord
to save the Current Record on the Form.
HTH
Van T. Dinh
MVP (Access)
Yes.-----Original Message-----
1. can my subform be invisible (visible set to no) and
make a command button that makes it visible?
Me.SubformCONTROL.Visible = True
should do.
It is possible to fudge...2. is there a way to turn off one-to-many so that the user
doesnot see that they can make another child....in fact
prohibit the user from making a second child?
However, the critical question is why do you set up a One-
to-Many relationship and use the Form / Subform
combination (which is designed especially for the One-to-
Many relationship) but you actually want (more or less) a
One-to-One relationship???
Yes if you use a Form as the Subform (or more technically3. can I remove the record advance at the bottom of the
subform window?
accurate, if you use a Form as the SourceObject of the
Subform Control). You can simply set the "Navigation
Buttons" Property of this Form (the SourceObject) to False.
Yes (use the AfterUpdate Event of the main Form) but why?4. A record is not added to table2 (the source table for
the subform) unless the user clicks into the subform and
inputs data in atleast one child. Is there anyway to
force a child to be created with "null" or "default" data
even if the user doesnot go into the subform.
Dummy Record doesn't have useful data and more often than
not create problems later. Dummy Records are never
necessary if you use Access correctly. I am yet to use
dummy Records in any database (and I have done quite a
few, some got more than 100 Tables).
It is probably related to the problem of using One-to-Many
relationship while you really want One-to-(at most)One
relationship.
OK, it is related to Q3. The SourceObject Property is the5.Is the source object property the name of the subform or
is it the name of the underlying table........wizard made
it the name of my subform!
name of the Table in your case. You can only see the name
of the Subform*CONTROL* in the DesignView of the Main Form.
Note that you are using the DatasheetView of the Table and
NOT a Form as the SourceObject. In this case, you canNOT
turn off the Navigation Buttons of the Subform.
DoCmd.Save does NOT save the current Record. DoCmd.Save6. I have a command button on my main form called "main
menu" which has code under it saying "Docmd.Save"
should that not save to the underlying table the new
record just input, before going to the main menu form?
If it does not, could there possibly be a validation rule
breach and Access just closed the form without alerting
the user?
saves the Design of the current data object, i.e. your
Form in this case. You actually need:
DoCmd.RunCommand acCmdSaveRecord
to save the Current Record on the Form.