Welcome to SPN

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

Sign Up Now!

Re: Chage event to AfterUpdate

Discussion in 'Information Technology' started by Ross, Oct 26, 2005.

  1. Ross

    Ross
    Expand Collapse
    Guest

    Hi John
    Had already done exactly as suggested and my my code had been adapted - it
    works a treat with Exit, but dosent work with AfterUpdate.
    My Code is :
    Private Sub List275_AfterUpdate()
    Dim strList As String
    Dim intLen As Integer
    Dim varSelectedRecord As Variant

    If Me.List275.ItemsSelected.Count > 0 Then
    For Each varSelectedRecord In List275.ItemsSelected
    strList = strList + List275.Column(4, varSelectedRecord) & ","
    Next varSelectedRecord

    intLen = Len(strList)
    [Text261] = Left(strList, intLen - 1)
    strList = ""
    End If

    If Me.List275.ItemsSelected.Count > 0 Then
    For Each varSelectedRecord In List275.ItemsSelected
    strList = strList + List275.Column(8, varSelectedRecord) & ","
    Next varSelectedRecord

    intLen = Len(strList)
    [Text266] = Left(strList, intLen - 1)
    strList = ""
    End If
    Command269.SetFocus
    End Sub
    It does run through the code without error messages, but does not display in
    the text boxes, as it does with Exit - bit of a brain ache, any more
    suggestions.
    Cheers Ross

    "John Vinson" wrote:

    > On Mon, 24 Oct 2005 23:12:03 -0700, "Ross"
    > <Ross@discussions.microsoft.com> wrote:
    >
    > >Hi There
    > >Have used following code kindly supplied by "xRoachx" and it works a treat,
    > >but need it to work with AfterUpate and not Exit, can't do this with (Cancel
    > >As Integer) and if I remove (Cancel As Integer) the code dosen't work.
    > >Any clues what I am doing wrong?

    >
    > The AfterUpdate event has no Cancel argument. Since you're not trying
    > to cancel anything, simply use the AfterUpdate event (rather than
    > Exit); just don't include the (Cancel as Integer). What do you mean by
    > "doesn't work"?
    >
    > The code builds strList and puts it in a form textbox named FieldName.
    > If you don't have a textbox named FieldName it will give you an error.
    > Did you adapt the code to your form, or just try to use it unmodified?
    >
    >
    > John W. Vinson[MVP]
    >
     
  2. Loading...


Share This Page