Hi Everyone,
Probably a very siMple, but for me very vexing, question:
I have a form that has a drop down box to select a value and datepicker to
pick a date. The subform doesn't activate until I click on the white space
where it should be. Then everything works fine, including the selection of
data for the subform, based on the values selected on the form.
How do I get the subform to start, and show, automatically after I select
the values in the form?
Many Thanks for your kind help
Pat.
scubadiver - 16 Jul 2007 11:40 GMT
Use the afterupdate event in the combo.
Forms![Main Form Name]![Subform Name].Visible = True
should work
> Hi Everyone,
>
[quoted text clipped - 9 lines]
> Many Thanks for your kind help
> Pat.
Pat Backowski - 16 Jul 2007 12:10 GMT
Hi Scubadiver,
Good Idea, but no cigar:
Private Sub DTPicker4_Updated(Code As Integer)
Forms![Vehicle Check Report]![VehicleChecklist subform].Visible = True
End Sub
No effect. Any other ideas?
Thanks,
Pat.
> Use the afterupdate event in the combo.
>
[quoted text clipped - 15 lines]
> > Many Thanks for your kind help
> > Pat.
scubadiver - 16 Jul 2007 12:34 GMT
I think it should be
Private Sub DTPicker4_AfterUpdate()
Forms![Vehicle Check Report]![VehicleChecklist subform].Visible = True
End Sub
> Hi Scubadiver,
>
[quoted text clipped - 29 lines]
> > > Many Thanks for your kind help
> > > Pat.
Pat Backowski - 16 Jul 2007 12:48 GMT
No, it doesn't like that at all - fyi, thihs is Acess 2003
> I think it should be
>
[quoted text clipped - 37 lines]
> > > > Many Thanks for your kind help
> > > > Pat.
scubadiver - 16 Jul 2007 12:58 GMT
ok. I am not familiar with 2003 but afterupdate would have been appropriate
(I would have thought)
> No, it doesn't like that at all - fyi, thihs is Acess 2003
>
[quoted text clipped - 39 lines]
> > > > > Many Thanks for your kind help
> > > > > Pat.
BruceM - 16 Jul 2007 12:54 GMT
Try Me.Refresh in the After Update event.
By way of general information, to reference a subform control (the
"container" on the main form in which the subform resides), just use the
control name as you would a text box or any other control:
Me.SubformName.Visible = True
To refer to a value in the subform's record source:
Forms!MainFormName!SubformName.Form!SomeField
> Hi Scubadiver,
>
[quoted text clipped - 33 lines]
>> > Many Thanks for your kind help
>> > Pat.
Pat Backowski - 16 Jul 2007 14:50 GMT
Thanks BruceM and Scubadiver!
The problem is that the DatePicker isn't updating until I TAB out of it.
I put a button on the form - it does nothing, but after selecting the date,
if I press the button, the subform shows - maybe due to the
Subform.Visible=True on the updating of the DatePicker, or maybe just
because....
Enough fun for one day - got to get something productive done
Thanks you guys for your kind help
Pat
> Hi Everyone,
>
[quoted text clipped - 9 lines]
> Many Thanks for your kind help
> Pat.
BruceM - 16 Jul 2007 15:02 GMT
The After Update is designed to work as you have described (except that
clicking out of the control should work too). Until you leave the control,
the update is still in progress, assuming something in the field has
changed. If there have been no changes to the field's data, there is no
update.
The subform control is visible, otherwise you would not see it as blank. If
it is not visible, you wouldn't see it at all.
Pressing a button on the form has nothing to do the DatePicker control's
After Update event unless the command button calls its After Update event.
> Thanks BruceM and Scubadiver!
>
[quoted text clipped - 26 lines]
>> Many Thanks for your kind help
>> Pat.