Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    BADebbie is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    33

    Populate Field in a Entry Form

    I have a Entry Form, and in this form we need to enter the Part #, and then the field below should populate with the correct description of that part number from the table it is in. The correct description is not coming up correctly when I hit enter. I believe it is just going to the next record instead of choosing the correct description. How can I make this populate correctly?



    Part# Part Description Quantity
    1 A/C ACCUMULATOR

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    The part# entry should be a combo box. When the user enters the part# it will automatically fill in description via the code below....
    the combo box has 2 columns; part, description.
    when the user presses enter ,the code loads the item in the second column:

    Code:
    sub cboPart_afterupdate()
     txtDescr= cboPart.column(1)      'Note,in VB columns start with zero
    end sub

  3. #3
    BADebbie is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    33
    That didn't seem to work. I can only see 1 column, which shows the Part #. Do I have to put in the code somewhere, or does it create it in the background when I create the Combo Box?

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Go to the AfterUpdate property for the combobox, select Event procedure, and copy the above code. Remove the ".column(1)" to get the first column.

  5. #5
    BADebbie is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    33
    I guess I'm doing something wrong. It still picks a random description.

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    On the DATA tab of the Properties dialog box -> What do you have as the ROW SOURCE property of the combo box? Should be a query or SQL.. post the SQL...

    On the FORMAT tab of the Properties dialog box -> What is the Column Count property value? Should be 2......


    Or you could post your dB......

  7. #7
    BADebbie is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    33
    Data Tab Row Source: SELECT [Parts].[Part#], [Parts].[Part Description] FROM Parts ORDER BY [Part Description];

    Format Tab Column Count = 2

  8. #8
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Is the bound column property set to 1?

  9. #9
    BADebbie is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    33
    Yes it is.

  10. #10
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Would you post your dB?

    It is really hard to give a good response when we don't have any idea of your tables structures, the form design or the fields involved.
    Only need a few records for testing.

  11. #11
    BADebbie is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    33
    I tried to attach it, but it is too big.

  12. #12
    BADebbie is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    33
    I can't make it any smaller to attach. I'll keep trying.

  13. #13
    BADebbie is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    33
    I'm down to nothing and it is still 884K, which is too big.

  14. #14
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Do a "Compact & Repair" , then Zip it.

    Max size of Zip file to attach is 2mb

  15. #15
    BADebbie is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    33
    Sorry to be a pain, but I have never zipped a file.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 10-13-2016, 12:32 PM
  2. Replies: 8
    Last Post: 04-23-2015, 08:36 PM
  3. Replies: 3
    Last Post: 02-25-2015, 04:48 PM
  4. Replies: 2
    Last Post: 12-04-2013, 05:38 PM
  5. Replies: 3
    Last Post: 10-03-2011, 02:33 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