Disable form is field is null

G

Guest

Problem:
Main Form with 2 subforms
If users input data in subform without inputting data in main form, the
subforms "orphan" (and data inputted into Main Form is then lost also)
So I need to disable the subforms
Main form field name: Shift RecordID
SubForm 1 name: Names Subform
SubForm 2 name: Event Log Query Subfom
 
G

Guest

If you want to lock the sub forms until data is inputed in field [Shift
RecordID] try this code

Me.[Names Subform].Locked = IsNull(Me.[Shift RecordID])
Me.[Event Log Query Subfom].Locked = IsNull(Me.[Shift RecordID])

In two places
1. OnCurrent event of the main form
2. AfterUpdate event of the field [Shift RecordID]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top