G
Guest
Hi
I have a mainform indexed on autonumber I
it has a subform that has an underlying child table indexed on an autonumber ID file als
they are linked as cycled - current record onl
on the main form I have a command button that opens the child subform and another command button that hides it
I want to create a YES/NO field in the mainform_TABLE that indicates whether there are any child records in that subform_child_TABLE....the default value set to NO
So functionally, if a user opens the subform and creates a child record, the value of the mainform_table_YES/NO_field will be changed to YES.......I will display this field next to the command buttons I mentioned so that the user will be able to tell if there are any child records previously created.
TEXTBOX YESNO COMMANDBUTTON OPENSUBFORM COMMANDBUTTON CLOSESUBFOR
How do I change the value of that YESNO field
I was thinking that when the user clicks the COMMANDBUTTON CLOSESUBFOR
some visual basic code could run that
Private sub CLSOESUBFORM_CLICK(
If CHILDTABLE AUTONUMBER ID that equals the currentrecord ID of the current mainform is not nul
THEN mainform!YESNO_filed = "true
close subfor
ELSE close for
----------- But I am not sure of the syntax of the code, nor if this is the best way to handle this.
I have a mainform indexed on autonumber I
it has a subform that has an underlying child table indexed on an autonumber ID file als
they are linked as cycled - current record onl
on the main form I have a command button that opens the child subform and another command button that hides it
I want to create a YES/NO field in the mainform_TABLE that indicates whether there are any child records in that subform_child_TABLE....the default value set to NO
So functionally, if a user opens the subform and creates a child record, the value of the mainform_table_YES/NO_field will be changed to YES.......I will display this field next to the command buttons I mentioned so that the user will be able to tell if there are any child records previously created.
TEXTBOX YESNO COMMANDBUTTON OPENSUBFORM COMMANDBUTTON CLOSESUBFOR
How do I change the value of that YESNO field
I was thinking that when the user clicks the COMMANDBUTTON CLOSESUBFOR
some visual basic code could run that
Private sub CLSOESUBFORM_CLICK(
If CHILDTABLE AUTONUMBER ID that equals the currentrecord ID of the current mainform is not nul
THEN mainform!YESNO_filed = "true
close subfor
ELSE close for
----------- But I am not sure of the syntax of the code, nor if this is the best way to handle this.