Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Moundridge, Kansas, USA
    Posts
    342
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Populate fields (Access 2003 SP2)

    Why doesn't this populate fields in a form?
    Private Sub cboPrisonName_AfterUpdate()

    Me!cboAddress = Me!Address
    Me!cboCity = Me!City
    Me!cboState = Me!State
    Me!cboPostalCode = Me!PostalCode
    'Me!cboComments = Me!Restrictions



    End Sub


    This is the SQL that is pulling data for the combobox.

    SELECT tblPrisonAddresses.PrisonName, tblPrisonAddresses.Address, tblPrisonAddresses.City, tblPrisonAddresses.State, tblPrisonAddresses.PostalCode, tblPrisonAddresses.Restrictions
    FROM tblPrisonAddresses;

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Populate fields (Access 2003 SP2)

    I don't know enough about the design of your form.

    Should the user be able to edit the address etc. after it has been filled in automatically or should it be fixed (depending on the prison name)?

  3. #3
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Moundridge, Kansas, USA
    Posts
    342
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Populate fields (Access 2003 SP2)

    Generally it will be fixed but occasionally it will be edited (rarely but needful).

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Populate fields (Access 2003 SP2)

    Try something like this:

    Me!cboAddress = Me!cboPrisonName.Column(1)
    Me!cboCity = Me!cboPrisonName.Column(2)
    Me!cboState = Me!cboPrisonName.Column(3)
    Me!cboPostalCode = Me!cboPrisonName.Column(4)
    Me!cboComments = Me!cboPrisonName.Column(5)

  5. #5
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Moundridge, Kansas, USA
    Posts
    342
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Populate fields (Access 2003 SP2)

    That did it! Thanks again!

Posting Permissions

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