Hi all
I’m trying to write a little code and keep coming up against barriers.
I have a main form with a sub form named sfrmYear. Also, on the main form I have another sub form named sfrmApproved.
SfrmApproved is actually linked to sfrmyear via a txtLink (=sfrmYear.Form!YearID) the txtLink being the master field.
Here’s my problem. For some reason Access is accepting the user typing into sfrmApproved when a Parent record has not been created for sfrmYear. In the tables the tblApproved will have the amount but not the YearID which will be blank.
I would like to create some code that will stop the user from doing this and warn them that they have to create a record within sfrmYear before creating a record within sfrmApproved.
I can’t imagine it would need a lot of code, however, I’m unsure what it would be and I’m finding difficulties refrencing to sfrmYear when I use sfrmApproved event to create the code.
Thank you in advance for any help anyone can provide.
I’m trying to write a little code and keep coming up against barriers.
I have a main form with a sub form named sfrmYear. Also, on the main form I have another sub form named sfrmApproved.
SfrmApproved is actually linked to sfrmyear via a txtLink (=sfrmYear.Form!YearID) the txtLink being the master field.
Here’s my problem. For some reason Access is accepting the user typing into sfrmApproved when a Parent record has not been created for sfrmYear. In the tables the tblApproved will have the amount but not the YearID which will be blank.
I would like to create some code that will stop the user from doing this and warn them that they have to create a record within sfrmYear before creating a record within sfrmApproved.
I can’t imagine it would need a lot of code, however, I’m unsure what it would be and I’m finding difficulties refrencing to sfrmYear when I use sfrmApproved event to create the code.
Thank you in advance for any help anyone can provide.