Missing properties in VB

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

    Missing properties in VB

    Hi

    I'm having a little stupid problem when trying to change properties in
    a Textbox (or a label) using Event Procedures.

    Im doing a report and want to change the Control Source in a textbox,
    depending of the result from a query, but the Control Source is not
    avalible in the listbox when typing: me.txttesting. <-- now a listbox
    is apering but I cant chose the Control Source property.
    The same is when trying to change the Caption in a Label.

    I know that I have done it before, but it is a long time ago, and I
    cant remember if it a prefence or an Add-in Im missing...

    Im using Access 2002

    Best regards
    John K
    Denmark
  • Tom van Stiphout

    #2
    Re: Missing properties in VB

    On 13 Aug 2004 06:28:07 -0700, jkrist10@hotmai l.com (John Kristensen)
    wrote:

    Go ahead and finish the statement manually. I'm pretty sure it will
    work.

    -Tom.

    [color=blue]
    >Hi
    >
    >I'm having a little stupid problem when trying to change properties in
    >a Textbox (or a label) using Event Procedures.
    >
    >Im doing a report and want to change the Control Source in a textbox,
    >depending of the result from a query, but the Control Source is not
    >avalible in the listbox when typing: me.txttesting. <-- now a listbox
    >is apering but I cant chose the Control Source property.
    >The same is when trying to change the Caption in a Label.
    >
    >I know that I have done it before, but it is a long time ago, and I
    >cant remember if it a prefence or an Add-in Im missing...
    >
    >Im using Access 2002
    >
    >Best regards
    >John K
    >Denmark[/color]

    Comment

    • fredg

      #3
      Re: Missing properties in VB

      On 13 Aug 2004 06:28:07 -0700, John Kristensen wrote:
      [color=blue]
      > Hi
      >
      > I'm having a little stupid problem when trying to change properties in
      > a Textbox (or a label) using Event Procedures.
      >
      > Im doing a report and want to change the Control Source in a textbox,
      > depending of the result from a query, but the Control Source is not
      > avalible in the listbox when typing: me.txttesting. <-- now a listbox
      > is apering but I cant chose the Control Source property.
      > The same is when trying to change the Caption in a Label.
      >
      > I know that I have done it before, but it is a long time ago, and I
      > cant remember if it a prefence or an Add-in Im missing...
      >
      > Im using Access 2002
      >
      > Best regards
      > John K
      > Denmark[/color]

      You can't rely on Intellisense.
      In a report, the PageBreak control does not show a visible property,
      but it does have one.

      For a label you can use:
      LabelName.Capti on = "A new caption"

      You can change a report control's control source in the Report's OPEN
      event:
      [ControlName].ControlSource = "='This is a new control source text'"
      or...
      [ControlName].Controlsource = "=[SomeField]"
      (Note the inclusion of the second = sign within the quotes.)

      HOWEVER, in a report, you cannot change the control source property of
      a control while the report is running (i.e. from within the detail
      events).

      It seems to me you should either use an unbound control with an
      expression as control source:
      =IIf([FieldName] = "xyz","Prin t this","Print that")

      or use an unbound control and give it a value in the Detail Format
      event:
      If [FieldName] = "xyz" Then
      [ControlName] = "Print this"
      Else
      [ControlName] = "Print that"
      End If

      --
      Fred
      Please only reply to this newsgroup.
      I do not reply to personal email.

      Comment

      • (Pete Cresswell)

        #4
        Re: Missing properties in VB

        RE/[color=blue]
        >avalible in the listbox when typing: me.txttesting. <-- now a listbox
        >is apering but I cant chose the Control Source property.
        >The same is when trying to change the Caption in a Label.
        >
        >I know that I have done it before,[/color]

        When that has happened to me, it was always because of some error in the rest of
        the VB code. Try a compile and see if it compiles.
        --
        PeteCresswell

        Comment

        Working...