Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Code to update poplate textbox on form

Discussion in 'Information Technology' started by red6000, Jul 28, 2006.

  1. red6000

    red6000
    Expand Collapse
    Guest

    Hi I have a table called CSRNames with 2 Columns, 1 called CSRNames and 1
    called TM.

    I then have a form which has 2 comboboxes, 1 for CSRNames column and 1 for
    the TM column.

    What I would like to do is for the TM combox box to auto populate based on
    the name chosen in the CSRName combox. I've tried the following, but it
    isn't working:

    Private Sub CSRName_Change()
    Dim varX As Variant
    varX = DLookup("[TM]", "CSRNames", "[CSRNames] = Me!CSRName.Value")
    Me!Team_Manager.Value = varX
    End Sub

    Any help appreciated.

    Thanks.
     
  2. Loading...

    Similar Threads Forum Date
    Introducing The Spn Code Of Forum Etiquette Announcements Feb 20, 2016
    UK Sikh 'code of silence' on sexual grooming Breaking News Sep 2, 2013
    Can a Dress Code Bar Ethnic and Religious Attire Based on Customer Preferences in the US? Questions and Answers May 3, 2011
    Pacific Code Exempts Religious Drivers (Fiji) Breaking News Feb 16, 2011
    Controversial Gurdwaras 'Breaking the Sikh Code' on Meat and Alcohol Hard Talk Dec 2, 2010

  3. red6000

    red6000
    Expand Collapse
    Guest

    Okay I've got it to work with the code below. However if I change the
    original name chosen, the Team_Manager field is not updating on screen
    although it does appear to be updating in background. Any ideas?

    Dim varX As Variant
    varX = DLookup("[TM]", "CSRNames", "[CSRNames] = '" & Me!CSRName & "'")
    Me!Team_Manager.Value = varX



    "red6000" <red1000002001@yahoo.com> wrote in message
    news:44bbf363$0$69362$ed2619ec@ptn-nntp-reader01.plus.net...
    > Hi I have a table called CSRNames with 2 Columns, 1 called CSRNames and 1
    > called TM.
    >
    > I then have a form which has 2 comboboxes, 1 for CSRNames column and 1 for
    > the TM column.
    >
    > What I would like to do is for the TM combox box to auto populate based on
    > the name chosen in the CSRName combox. I've tried the following, but it
    > isn't working:
    >
    > Private Sub CSRName_Change()
    > Dim varX As Variant
    > varX = DLookup("[TM]", "CSRNames", "[CSRNames] = Me!CSRName.Value")
    > Me!Team_Manager.Value = varX
    > End Sub
    >
    > Any help appreciated.
    >
    > Thanks.
    >
     
  4. Douglas J. Steele

    Douglas J. Steele
    Expand Collapse
    Guest

    See whether http://office.microsoft.com/en-ca/assistance/HA011730581033.aspx
    helps.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no private e-mails, please)


    "red6000" <red1000002001@yahoo.com> wrote in message
    news:44bbf8df$0$22093$ed2619ec@ptn-nntp-reader01.plus.net...
    > Okay I've got it to work with the code below. However if I change the
    > original name chosen, the Team_Manager field is not updating on screen
    > although it does appear to be updating in background. Any ideas?
    >
    > Dim varX As Variant
    > varX = DLookup("[TM]", "CSRNames", "[CSRNames] = '" & Me!CSRName & "'")
    > Me!Team_Manager.Value = varX
    >
    >
    >
    > "red6000" <red1000002001@yahoo.com> wrote in message
    > news:44bbf363$0$69362$ed2619ec@ptn-nntp-reader01.plus.net...
    >> Hi I have a table called CSRNames with 2 Columns, 1 called CSRNames and 1
    >> called TM.
    >>
    >> I then have a form which has 2 comboboxes, 1 for CSRNames column and 1
    >> for the TM column.
    >>
    >> What I would like to do is for the TM combox box to auto populate based
    >> on the name chosen in the CSRName combox. I've tried the following, but
    >> it isn't working:
    >>
    >> Private Sub CSRName_Change()
    >> Dim varX As Variant
    >> varX = DLookup("[TM]", "CSRNames", "[CSRNames] = Me!CSRName.Value")
    >> Me!Team_Manager.Value = varX
    >> End Sub
    >>
    >> Any help appreciated.
    >>
    >> Thanks.
    >>

    >
    >
     
  5. red6000

    red6000
    Expand Collapse
    Guest

    Brilliant, thanks Doug.

    "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    news:eNo7IieqGHA.2304@TK2MSFTNGP03.phx.gbl...
    > See whether
    > http://office.microsoft.com/en-ca/assistance/HA011730581033.aspx helps.
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no private e-mails, please)
    >
    >
    > "red6000" <red1000002001@yahoo.com> wrote in message
    > news:44bbf8df$0$22093$ed2619ec@ptn-nntp-reader01.plus.net...
    >> Okay I've got it to work with the code below. However if I change the
    >> original name chosen, the Team_Manager field is not updating on screen
    >> although it does appear to be updating in background. Any ideas?
    >>
    >> Dim varX As Variant
    >> varX = DLookup("[TM]", "CSRNames", "[CSRNames] = '" & Me!CSRName & "'")
    >> Me!Team_Manager.Value = varX
    >>
    >>
    >>
    >> "red6000" <red1000002001@yahoo.com> wrote in message
    >> news:44bbf363$0$69362$ed2619ec@ptn-nntp-reader01.plus.net...
    >>> Hi I have a table called CSRNames with 2 Columns, 1 called CSRNames and
    >>> 1 called TM.
    >>>
    >>> I then have a form which has 2 comboboxes, 1 for CSRNames column and 1
    >>> for the TM column.
    >>>
    >>> What I would like to do is for the TM combox box to auto populate based
    >>> on the name chosen in the CSRName combox. I've tried the following, but
    >>> it isn't working:
    >>>
    >>> Private Sub CSRName_Change()
    >>> Dim varX As Variant
    >>> varX = DLookup("[TM]", "CSRNames", "[CSRNames] = Me!CSRName.Value")
    >>> Me!Team_Manager.Value = varX
    >>> End Sub
    >>>
    >>> Any help appreciated.
    >>>
    >>> Thanks.
    >>>

    >>
    >>

    >
    >
     

Share This Page