Rachael
11-04-2000, 08:40 PM
I'm pretty new to all of this so my problem is probably pretty basic. I have a form with 2 subforms embedded on it. When a new record is entered I don't want the subforms to be visible until some data as been entered into the main form (so that the auto number is available) this seems the best way to stop data entry in the subforms first and causing 'Null'issues etc. Hope someone can help thanks.
Richie
11-04-2000, 11:40 PM
I prefer to use an entry event on the subform something like
If IsNull(Me.YourTextBox) Then
Beep
MsgBox "STOP please enter data on main form before entering subform.", vbOKOnly, ""
SendKeys "{ESC}"
YourTextbox.SetFocus
Jack Cowley
11-05-2000, 11:43 AM
Another method that might work for you is to put code in the On Current event of the Main Form. The code might look something like:
If Me.NewRecord Then
Me![Subform1].Visible = False
Me![Subform2].Visible = False
End If
Then in the After Update event of the first Text box on the Main Form you might have code like this:
Me![Subform1].Visible = True
Me![Subform2].Visible = True
HTH,
Jack
Rachael
11-05-2000, 08:04 PM
Thankyou very, very much. I'm on a very sharp learning curve and your help (and time) is very much appreciated. The form now works great!
Thanks Rachael