Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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: <font color=448800>Me.MondayActivities_subform.SetFocus </font color=448800> for example. However, there is no Intellisense option for <font color=448800>.Value</font color=448800> and when I try to assign it the value using, say, <font color=448800>Me.MondayActivities_subform.SetFocus = Me.W_E</font color=448800>, I get the annoying <font color=red>Object doesn't support this property or method</font color=red>. This follows from not having <font color=448800>.Value</font color=448800> 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 <font color=448800>W_E</font color=448800> and <font color=448800>MondayDate</font color=448800> controls are set to <font color=blue>Date/Time</font color=blue>. Also, the subform is a Tabcontrol.

    Thanks!

  2. #2
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    NYC,USA,Earth
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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! <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •