Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    AfterUpdate event (AccessXP)

    Please assess the appropriate Idiot tax for the following.

    I want two fields to be automatically completed once data placed in a third control. The control that data is placed in is called DuesPaid. This combo has a TableQuery Row Source Type and the row source has the following SQL statement: SELECT tblFrequency.Frequency, tblFrequency.Divider, tblFrequency.ID, tblFrequency.FrequencyNumber FROM tblFrequency ORDER BY tblFrequency.Frequency;

    I placed the following in the DuesPaid_AfterUpdate() event

    Private Sub DuesPaid_AfterUpdate()
    Dim Inti As Integer
    Divider = DuesPaid.Column(1)
    FrequencyNumber = DuesPaid.Column(1)
    End Sub

    The divider changes like it should when you change the value in the DuesPaid combo. But nothing happens with the FrequencyNumber field.

    What am I doing wrong? Thank you. I hope you know I do appreciate your help to no end.

    <img src=/S/sad.gif border=0 alt=sad width=15 height=15> please <img src=/S/bash.gif border=0 alt=bash width=35 height=39> as appropriate.

    Fay

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: AfterUpdate event (AccessXP)

    The frequence number field is the 4th field in the SELECT query, so it should probably read:
    FrequencyNumber = DuesPaid.Column(3)
    I presume that FrequenceNumber is a control on the form?

    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: AfterUpdate event (AccessXP)

    Fay

    A few things.
    <pre> Private Sub DuesPaid_AfterUpdate()
    Dim Inti As Integer
    Divider = DuesPaid.Column(1)
    FrequencyNumber = DuesPaid.Column(1)
    End Sub
    </pre>

    * It doesn't really matter, but you don't need the Dim inti as integer
    * Are you really trying to set FrequencyNumber to the same value as Divider, or should that be a different column number? Column(3) perhaps?
    * How many columns do you have in the combo? Note that this is not the same as the number of columns of data in the RowSource. Can you see Frequency Number in the drop down list in the combo?

    The Number of columns is set with the ColumnCount property int he format group.
    Regards
    John



  4. #4
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AfterUpdate event (AccessXP)

    Thank you Pat and John. Thank God John you added the comments at the bottom. The kicker was the column count change that and it was a cake walk.

    Fay

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •