• Form/Subform Control Manipulation (2000 SR-1, Win 2000 Prof)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Form/Subform Control Manipulation (2000 SR-1, Win 2000 Prof)

    Author
    Topic
    #382001

    I thought this would be easy, but i’m getting confounded.

    I have a form with a subform (the subform is based on a different table than the parent form) and the subform is designed to capture activities for a week. On the parent form there is a field, Week Ending ([W_E]) and on the Monday subform there is [MondayDate]. What I want to do is, after entering the Week Ending info, is to populate the MondayDate control in the subform. There is already code written to populate the subsequent weekdays on the subform based on the value for MondayDate.

    I can reference the MondayDate field from VB: Me.MondayActivities_subform.SetFocus for example. However, there is no Intellisense option for .Value and when I try to assign it the value using, say, Me.MondayActivities_subform.SetFocus = Me.W_E, I get the annoying Object doesn’t support this property or method. This follows from not having .Value available in Intellisense.

    Any suggestions? Obviously it would be a Good Thing to have the user input a date once and have the rest of the info automatically generated. BTW, I double-checked that both the W_E and MondayDate controls are set to Date/Time. Also, the subform is a Tabcontrol.

    Thanks!

    Viewing 0 reply threads
    Author
    Replies
    • #646046

      It looks to me that you referenced the subform control with “Me.MondayActivities_subform.SetFocus”. You want to set the value of a control on the subform you need to replace setfocus with either Form!ControlName or just ControlName. The value property is the default property so you do not need to specify it. Try using the expression builder – it’s perfect for this sort of thing.

      • #646050

        Yeah, that works. Thought I’d tried that before but apparently not. Turns out you have to refresh a couple of times for the MondayDate to take and the other dates to take, but the puppy works.

        Kudos! cheers

    Viewing 0 reply threads
    Reply To: Form/Subform Control Manipulation (2000 SR-1, Win 2000 Prof)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: