Concatenating

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

    Concatenating

    I need to have the controls (images) in the form, frmName evaluated to find
    out which ones will be made visible. The names of the controls are
    Image51X, Image51Z, Image52X, Image52Z, etc. The code needs to read:

    Do While...
    Forms![frmName].[??????].Visible = True
    .MoveNext
    Loop

    I am unable to get the syntax correct to increment to image names.

    --
    Bob Rice
    Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!



  • Douglas J. Steele

    #2
    Re: Concatenating

    If you've got the control name stored in a variable strControl, try:

    Forms![frmName].Controls(strCo ntrol).Visible = True



    --
    Doug Steele, Microsoft Access MVP

    (No private e-mails, please)



    "Bob Rice" <arrice2@comcas t.net> wrote in message
    news:CeUrb.1170 19$mZ5.790066@a ttbi_s54...[color=blue]
    > I need to have the controls (images) in the form, frmName evaluated to[/color]
    find[color=blue]
    > out which ones will be made visible. The names of the controls are
    > Image51X, Image51Z, Image52X, Image52Z, etc. The code needs to read:
    >
    > Do While...
    > Forms![frmName].[??????].Visible = True
    > .MoveNext
    > Loop
    >
    > I am unable to get the syntax correct to increment to image names.
    >
    > --
    > Bob Rice
    > www.geocities.com/arrice.geo
    >
    >[/color]


    Comment

    • Bob Rice

      #3
      Re: Concatenating


      Still can't get it.

      site = 51X
      Do While site = .[Site Name]
      If (.[DateIn] >= indate And .[DateIn] < outdate) Or (.[DateIn] <
      indate And .[DateOut] > indate) Then
      'Forms![frm Park].[Image51X].Visible = True --- *****
      This line works fine

      goodtext = "Image" & site
      Forms![frm Park].[goodtext].Visible = True
      End If
      .MoveNext
      Loop



      goodtext won't work. Trying "Forms![frmName].Controls(strCo ntrol).Visible =
      True" won't do it either.

      --
      Bob Rice
      Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!

      "Douglas J. Steele" <NOSPAM_djsteel e@NOSPAM_canada .com> wrote in message
      news:%23B7bjo9p DHA.2740@TK2MSF TNGP09.phx.gbl. ..[color=blue]
      > If you've got the control name stored in a variable strControl, try:
      >
      > Forms![frmName].Controls(strCo ntrol).Visible = True
      >
      >
      >
      > --
      > Doug Steele, Microsoft Access MVP
      > http://I.Am/DougSteele
      > (No private e-mails, please)
      >
      >
      >
      > "Bob Rice" <arrice2@comcas t.net> wrote in message
      > news:CeUrb.1170 19$mZ5.790066@a ttbi_s54...[color=green]
      > > I need to have the controls (images) in the form, frmName evaluated to[/color]
      > find[color=green]
      > > out which ones will be made visible. The names of the controls are
      > > Image51X, Image51Z, Image52X, Image52Z, etc. The code needs to read:
      > >
      > > Do While...
      > > Forms![frmName].[??????].Visible = True
      > > .MoveNext
      > > Loop
      > >
      > > I am unable to get the syntax correct to increment to image names.
      > >
      > > --
      > > Bob Rice
      > > www.geocities.com/arrice.geo
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Douglas J. Steele

        #4
        Re: Concatenating

        Reread what I suggested.

        Forms![frmName].Controls(strCo ntrol).Visible = True

        In other words,

        Forms![frm Park].Controls(goodt ext).Visible = True

        not

        Forms![frm Park].[goodtext].Visible = True


        --
        Doug Steele, Microsoft Access MVP

        (No private e-mails, please)



        "Bob Rice" <arrice2@comcas t.net> wrote in message
        news:fBUrb.1193 66$275.345950@a ttbi_s53...[color=blue]
        >
        > Still can't get it.
        >
        > site = 51X
        > Do While site = .[Site Name]
        > If (.[DateIn] >= indate And .[DateIn] < outdate) Or (.[DateIn] <
        > indate And .[DateOut] > indate) Then
        > 'Forms![frm Park].[Image51X].Visible = True --- *****
        > This line works fine
        >
        > goodtext = "Image" & site
        > Forms![frm Park].[goodtext].Visible = True
        > End If
        > .MoveNext
        > Loop
        >
        >
        >
        > goodtext won't work. Trying "Forms![frmName].Controls(strCo ntrol).Visible[/color]
        =[color=blue]
        > True" won't do it either.
        >
        > --
        > Bob Rice
        > www.geocities.com/arrice.geo
        > "Douglas J. Steele" <NOSPAM_djsteel e@NOSPAM_canada .com> wrote in message
        > news:%23B7bjo9p DHA.2740@TK2MSF TNGP09.phx.gbl. ..[color=green]
        > > If you've got the control name stored in a variable strControl, try:
        > >
        > > Forms![frmName].Controls(strCo ntrol).Visible = True
        > >
        > >
        > >
        > > --
        > > Doug Steele, Microsoft Access MVP
        > > http://I.Am/DougSteele
        > > (No private e-mails, please)
        > >
        > >
        > >
        > > "Bob Rice" <arrice2@comcas t.net> wrote in message
        > > news:CeUrb.1170 19$mZ5.790066@a ttbi_s54...[color=darkred]
        > > > I need to have the controls (images) in the form, frmName evaluated to[/color]
        > > find[color=darkred]
        > > > out which ones will be made visible. The names of the controls are
        > > > Image51X, Image51Z, Image52X, Image52Z, etc. The code needs to read:
        > > >
        > > > Do While...
        > > > Forms![frmName].[??????].Visible = True
        > > > .MoveNext
        > > > Loop
        > > >
        > > > I am unable to get the syntax correct to increment to image names.
        > > >
        > > > --
        > > > Bob Rice
        > > > www.geocities.com/arrice.geo
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...