hi,
I have mainform with two cmdbuttons:
1- Save
2- Add Detail
the mainform has subform which is set to invisible, if I click Add Detail the subform appears, if not and user clicked Save the fields in the mainform will move to new blank record without having any details
what I need to do, when the user click save and the fields in the subform is not filled, In this case I need the save action (moving to next blank record) to be cancelled
I had some suggestion that prompt me to write the code. if the subform visible make the save button enabled if invisible make it disabled , but when I did so, I found that the user click Add Detail to make the subform appeared then click Save
so I need to cancel or delete the data saved in the mainform if the subform has no record.
because when I move the focus from the mainform to the subform the data in the mainform will be already saved after the focus on the subform, even if the user click exit the data in the mainform will be still saved, and this will be big problem for me.because of two reasons:
1- as soon as the user click save record selector will move to new record.
2- if click Exit the form will be closed and mainform data will be still saved
so I need to do this:
1- if click save and subform with no data then setfocus the subform, if subform filled , move to add new record
2- if click exit and subform with no data then delete the data saved in the mainform, if not, delete all the data in mainform and subform
please I need any help with this
appreciate any suggestions