Results 1 to 11 of 11
  1. #1
    nancym is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    5

    Autopopulate field

    Hi, I have a table that has included 2 fields, Location & rate.
    I have a form that has these two fields in them. The Location is a drop down list, and I would like the rate to autopopulate when a location is chosen.
    _ ComboName.Column(2) does not work.
    Any suggestions?


    Thanks Nan

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The Column() value is zero based so (2) would be the 3rd column. Does that help?

  3. #3
    nancym is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    5
    Quote Originally Posted by RuralGuy View Post
    The Column() value is zero based so (2) would be the 3rd column. Does that help?

    Hi, no I get nothing, Thanks anyway

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Do you have 3 columns of data in your ComboBox?

  5. #5
    nancym is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    5
    Quote Originally Posted by RuralGuy View Post
    Do you have 3 columns of data in your ComboBox?

    Hi, I have the ID, Location, and Rate.
    I have tried =CcomboName.Column(1) then (2) then (3)
    I only get a return of the location for the rate when I use the (1)
    Nan

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What do you have on the Format tab ofn the Property sheet for the cbo for ColumnCount and ColumnWidths?

  7. #7
    nancym is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    5
    Quote Originally Posted by RuralGuy View Post
    What do you have on the Format tab ofn the Property sheet for the cbo for ColumnCount and ColumnWidths?

    column count=2 width=0";1"

    If I put in (1) in the Combo Name it gives me the Location back ex. Boston, but not the rate associated with it.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Change the ColumnCount to 3 and see what happens when you use .Column(2).

  9. #9
    nancym is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    5
    Quote Originally Posted by RuralGuy View Post
    Change the ColumnCount to 3 and see what happens when you use .Column(2).
    Hi, That didn't do anything, I made a copy of the table, then re-inserted the fields from the table, changed the format of rate to currency, and now it works. Thanks you for your help. how do I mark this as solved?

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by nancym View Post
    Thank you for your help. how do I mark this as solved?
    It is under Thread Tools at the top of the thread.

  11. #11
    mejia.j88 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228

    Cool

    you should create a query from your table that only includes the info you want,
    i.e. location and rate.

    use this qry as then row source for location.

    then:

    Private Sub LOCATIONFIELDNAME_AfterUpdate()
    Me.RATEFIELDNAME = Me.LOCATIONFIELDNAME.Column(1) 'rate
    End Sub

    make sure rate is the second column of your query.

    does this help?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. autopopulate not working
    By slimjen in forum Forms
    Replies: 7
    Last Post: 09-16-2011, 01:38 PM
  2. Replies: 1
    Last Post: 06-21-2011, 03:34 AM
  3. Replies: 9
    Last Post: 09-23-2010, 10:42 AM
  4. Autopopulate NOT allowing overwrite
    By ChrisCione in forum Forms
    Replies: 8
    Last Post: 09-03-2010, 06:29 PM
  5. Acess autopopulate a query
    By stendec in forum Access
    Replies: 0
    Last Post: 10-20-2009, 03:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums