I have a main form called "Form" and a subform on the main form. That Subform is called "ProdSubForm".
The are linked Master to child by the field "SkuID".
"Form" is from the table called "SKUs" and "ProdSubForm" is from the table called "Products".
There is a relationship between the tables "SKUs" and "Products" on the "SkuID" field.
I need "ProdSubForm" to be locked until the info is put into the main form called "Form".
Until this happens there is no "SkuID" produced in the "SKUs" table and there for no "ProductID" in the "Products" table can be produced and synced back to "SkuID".
I have coded in VBA so far
Private Sub Form_Current()
If IsNull(Me.SkuID) Then
Forms!Form1.Form![ProdSubForm].Enabled = False
Forms!Form1.Form![ProdSubForm].Enabled = True
But the subform "ProdConSubForm" stays locked until I go to next or previous record and come back.
The only time "ProdConSubForm" Should be locked is during a add new record. I have a add new record button called "btnAddNewRecord".
How do I fix this and maybe add a error message or such to info the user to fill in the Main "Form" first.
Also is there a way to set a specific number of records on the contentious "ProdConSubForm".
The main form "Form" is a single record form.