syntax question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • deko

    #1

    syntax question

    WHERE (tblTxJournal.T xAcct_ID IN (SELECT TxAcct_ID FROM tblTxAcct)) AND
    (DatePart("q",[TxDate])=2) AND
    (Year([TxDate])=[Forms]![frmMain]![frmTo]![cbxYear_To]) ...

    is this okay, or should the last part be:

    [Forms]![frmMain]![frmTo].[Form]![cbxYear_To])

    Thanks in advance...



  • Wayne Morgan

    #2
    Re: syntax question

    Actually, either will probably work, since you are using the ! instead of a period.

    The [frmTo] part needs to be the name of the control on the main form that holds the
    subform, not the name of the subform itself.

    --
    Wayne Morgan


    "deko" <dje422@hotmail .com> wrote in message
    news:MeVjb.1667 $TA2.93@newssvr 27.news.prodigy .com...[color=blue]
    > WHERE (tblTxJournal.T xAcct_ID IN (SELECT TxAcct_ID FROM tblTxAcct)) AND
    > (DatePart("q",[TxDate])=2) AND
    > (Year([TxDate])=[Forms]![frmMain]![frmTo]![cbxYear_To]) ...
    >
    > is this okay, or should the last part be:
    >
    > [Forms]![frmMain]![frmTo].[Form]![cbxYear_To])
    >
    > Thanks in advance...
    >
    >
    >[/color]


    Comment

    • deko

      #3
      Re: syntax question

      From what I've read elsewhere, [Forms]![frmMain]![frmTo].[Form]![cbxYear_To]
      is the "full path" - it seems this is the more reliable way to go... I need
      a rule to follow, so this might as well be it.

      thanks for the reply!

      "Wayne Morgan" <comprev_gothro ughthenewsgroup @hotmail.com> wrote in message
      news:nh4kb.1268 7$sn6.7734@news svr33.news.prod igy.com...[color=blue]
      > Actually, either will probably work, since you are using the ! instead of[/color]
      a period.[color=blue]
      >
      > The [frmTo] part needs to be the name of the control on the main form that[/color]
      holds the[color=blue]
      > subform, not the name of the subform itself.
      >
      > --
      > Wayne Morgan
      >
      >
      > "deko" <dje422@hotmail .com> wrote in message
      > news:MeVjb.1667 $TA2.93@newssvr 27.news.prodigy .com...[color=green]
      > > WHERE (tblTxJournal.T xAcct_ID IN (SELECT TxAcct_ID FROM tblTxAcct)) AND
      > > (DatePart("q",[TxDate])=2) AND
      > > (Year([TxDate])=[Forms]![frmMain]![frmTo]![cbxYear_To]) ...
      > >
      > > is this okay, or should the last part be:
      > >
      > > [Forms]![frmMain]![frmTo].[Form]![cbxYear_To])
      > >
      > > Thanks in advance...
      > >
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Wayne Morgan

        #4
        Re: syntax question

        You won't go wrong by spelling it out. The other way you have to know what
        the defaults are.

        --
        Wayne Morgan


        "deko" <dje422@hotmail .com> wrote in message
        news:vK8kb.1348 $aY6.263@newssv r25.news.prodig y.com...[color=blue]
        > From what I've read elsewhere,[/color]
        [Forms]![frmMain]![frmTo].[Form]![cbxYear_To][color=blue]
        > is the "full path" - it seems this is the more reliable way to go... I[/color]
        need[color=blue]
        > a rule to follow, so this might as well be it.[/color]


        Comment

        Working...