Results 1 to 4 of 4
  1. #1
    Ternick is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2013
    Posts
    25

    Drop box pick auto filling in other values(2003)

    I am trying to make a Per-diem tracking program, and I don't know alot about access. I am trying to get it so when I select the county from a drop down box it fills in the meal and lodging alotments. I have the drop down box there, and on another form the County list with meal and lodging alotments.



    Also I am trying to get this program to do other things so if anyone knows a website that could help i'd be happy for it. This is for Access 2003

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Here's a step-by-step; you'll have to replace all Field names with your actual names:

    Place a Combobox on your Form. When the Wizard comes up

    1. Select "I want combobox to look up values in a table/query"
    2. Select your Table or Query
    3. Click to move County to right hand box
    4. Click to move MealAllotments to right hand box
    5. Click to move LodgingAllotments to right hand box
    6. Sort by County field
    7. Select "Remember Value for Later Use"
    8. Chose a caption for label (if desired)
    9. Click on Finish

    Now, assuming that the Fields, in the Combobox, reading from Left-to-Right are

    County | MealAllotments | LodgingAllotments

    in the AfterUpdate event for your Combobox use this code:

    Code:
    Private Sub YourComboBoxName_AfterUpdate()
      Me.County = Me.YourComboBoxName.Column(0)
      Me.MealAllotments = Me.YourComboBoxName.Column(1)
      Me.LodgingAllotments = Me.YourComboBoxName.Column(2)
    End Sub

    and Bob's your uncle! Notice that the Column Index is Zero-based.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Ternick is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2013
    Posts
    25
    First thank you for the help, but it isn't working right. I fallowed your steps and when I go to the View option to test it, it comes up saying Macro is not their or new and not saved. I have tryed with the index base as you did, and how it is in the table I have the information in and does the same thing.

  4. #4
    Ternick is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2013
    Posts
    25
    Ok fixed that problem, but now it comes up saying the Value I have listed for the meal alotment box and what is getting put in don't match, but I have double checked and they are both set for Currency

    Fixed

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

Similar Threads

  1. Replies: 5
    Last Post: 08-28-2012, 03:23 PM
  2. Auto display name when filling form
    By mohiahmed in forum Forms
    Replies: 3
    Last Post: 01-22-2012, 02:35 PM
  3. Auto filling a field in a table. Help please
    By tdanko128 in forum Access
    Replies: 2
    Last Post: 01-18-2011, 12:22 PM
  4. Auto filling a form from table
    By JoScSM in forum Forms
    Replies: 1
    Last Post: 11-02-2010, 08:09 AM
  5. Auto Filling
    By tgavin in forum Forms
    Replies: 2
    Last Post: 08-02-2010, 10:47 AM

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