mark curtis
Registered User.
- Local time
- Today, 15:31
- Joined
- Oct 9, 2000
- Messages
- 457
Dear all,
I have two form and subform both in datasheet view.
My question is that if I enter the subform without inserting a record in the main form I want to pop a msgbox up to let them know the ID key needs activating by populating a field.
The parent child relationship works ok but I want to let the users know in a more freindly way that they have violated key realationship without the default message.
I used the following but it seems not to like it. Basically when the child record receives the focus it looks to the parent record and if it contains the text <Mandatory> or is null then it should send the focus back to the parent record via a message box.
Private Sub Form_GotFocus()
If IsNull(Forms![frmDocumentRegister]![fsubProduct]![txtProductName]) Or Forms![frmDocumentRegister]![fsubProduct]![txtProductName] = "<Mandatory>" Then
Forms![frmDocumentRegister]![fsubProduct]![txtProductName].SetFocus
MsgBox "njnh"
End If
End Sub
Thanks
Mark
I have two form and subform both in datasheet view.
My question is that if I enter the subform without inserting a record in the main form I want to pop a msgbox up to let them know the ID key needs activating by populating a field.
The parent child relationship works ok but I want to let the users know in a more freindly way that they have violated key realationship without the default message.
I used the following but it seems not to like it. Basically when the child record receives the focus it looks to the parent record and if it contains the text <Mandatory> or is null then it should send the focus back to the parent record via a message box.
Private Sub Form_GotFocus()
If IsNull(Forms![frmDocumentRegister]![fsubProduct]![txtProductName]) Or Forms![frmDocumentRegister]![fsubProduct]![txtProductName] = "<Mandatory>" Then
Forms![frmDocumentRegister]![fsubProduct]![txtProductName].SetFocus
MsgBox "njnh"
End If
End Sub
Thanks
Mark