View Single Post
  #2  
Old April 30th, 2010, 11:49 PM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Force user to click on Main Form First??

One way is to use the Before Insert event of the subform.

Private Sub Form_BeforeInsert(Cancel As Integer)
If Me.Parent.NewRecord Then
Cancel = True
MsgBox "Please enter the main form record first."
End If
End Sub


Another way is to hide or disable the subform and then use the
BeforeInsert event of the main form to show/enable it. Then it becomes
available as soon as they type the first character into the main form.

You also need to test the NewRecord property in the Current event of the
main form so you can then disable/hide the subform again.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"TheLee via AccessMonster.com" u59624@uwe wrote in message
news:a752202dda107@uwe...
Hello -
Is it possible to force a user to select a field in the Main form prior to
inputing any info into the subforms? Or is it possible for the Main form
to
assign and ID to the record when a user begins filling out the subform?

Thanks -
Lee -

--
Message posted via http://www.accessmonster.com