1) This is a bit tricky, generally people try to go about it with a
different design, but you may be able to use the unload event of the main
form to cancel it if no records are present in the subform's recordset...
Private Sub Form_Unload(Cancel As Integer)
If Me.SubControlName.Form.Recordset.Recordcount = 0 Then
MsgBox "Please enter detail records..."
Cancel = True
End If
End Sub
2) You can't (that I'm aware of) put a password on it, but you can
right-click the object name, select properties, and set it to hidden. With
tables at least, you can prefix them as "USys" to hide them (assuming that
you haven't turned off hide system objects in settings), but I'm not sure
this applies to macros or modules.
As an alternative (actually, rather than alternative, this is standardly the
"correct" way to do it), convert your file to an .mde (for versions 2003 and
before) or an .accde (versions 2007 and 10). This removes all code from the
user, and this would be the distributable copy.
hth
Hello,
1) Please how can i make sure that a subform must be filled if there are any
[quoted text clipped - 3 lines]
Please i will appreciate it if you help me with this.
Thank you in advance.