"Strike Eagle" <StrikeEagle[ at ]discussions.microsoft.com> wrote in message news:DC81E3C9-06E0-4755-B504-4DDE8974EE50[ at ]microsoft.com...
[Quoted Text] > I need help > > I have a form named "Flight Roster" that has a subform named EPR which has
a > textbox named PreviousCloseout. On the "On Enter" event of the subform I > want to define an If Then statement in VBA to check to see if the date it > contains is < the current date. If it is, then I will run a message box to > see if the user wants to automatically update it or not. The problem I run > into is to how to properly define the form object PreviousCloseout in VBA. > > I've tried many different versions but I can't figure it out. > > Obviously things like the following with many variations don't work. > > If Forms![Flight Roster].EPR!PreviousCloseout.value < Date Then > > Please help me out. I have the rest of code working fine, I just need to > figure out how to define that form.subform.textbox in vba when the event is > on the subform. > > Thanks > Dan
Probably:
If Forms![Flight Roster]!EPR.Form!PreviousCloseout < Date Then
Or, more simply:
If Me!EPR.Form!PreviousCloseout < Date Then
Basically, you need to refer to the Form property of the subform control.
|