Results 1 to 2 of 2
  1. #1
    sergio.tulkas is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2016
    Posts
    1

    Programming optional auto-fill

    Good morning everybody,

    I have a problem with access. I am a total beginner and I am working in a company that already uses it.





    Doll factory problem.



    I have several lists of unique objects (doll parts) identified by their serial number. For instance I have a list of doll heads (SN 1, SN 2 etc..), a list of bodies, right arms etc. Each list is encoded in an access table.



    I have also a list of dolls (or standard dolls), defined by a doll serial number and made of a predefined combination of parts, for instance doll SN1 is made of head SN1, body SN2, right arm SN1 etc...



    In the factory the dolls are often disassembled and re-assembled and different dolls can use same unique components, for instance


    doll SN1 : head SN1, body SN2, right arm SN1

    doll SN2 : head SN1, body SN3, right arm SN2



    I have a table for each doll part : one for the heads, one for the dobies...and a table for the standard dolls descpription.



    We performed many test on the dolls. For each test we used a different doll. We both used standard dolls (defined in the relevant table) and also customised dolls defined ad hoc.



    I have a « test » table. In the first column of this table I have the standard doll SN (if applicable), in the second/third/fourth columns I have the doll head/body/right arm SN (always applicable).

    If the standard doll SN is empty it means that the doll is a customised one without SN. It has been assembled just for this special test. There is no special table for those custom dolls: they are just described by their part list in the test table.



    The question is : how can I make the head/body/right arm SN columns in the test table fill automatically, when the SN of a standard doll is defined? And how can I allow the user to fill those fields manually, if the doll is not a standard one (so there is no doll SN)?

    Thanks a lot,

    Sergio

  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

    1. Set up Textboxes on your Form, for all items, each one bound to the appropriate Field in the Form's underlying Table
    2. Place a Combobox on your form. When the wizard comes up
    3. Select "I want Combobox to look up values in a table/query"
    4. Select your Parts Table
    5. Click and move each Field to the right hand box
    6. Sort by DollName
    7. Select "Remember Value for Later Use"
    8. Chose a Caption for the Label of the Combobox (if desired)
    9. Click on Finish


    Assuming that the items were added in the order of DollName, Head, Body, RightArm and LeftArm, in the AfterUpdate event for your Combobox

    Code:
    Private Sub YourComboBox_AfterUpdate()
      Me.DollName= Me.YourComboBox.Column(0)
      Me.Head = Me.YourComboBox.Column(1)
      Me.Body = Me.YourComboBox.Column(2)
      Me.RightArm = Me.YourComboBox.Column(3)
      Me.LeftArm = Me.YourComboBox.Column(4)
    End Sub


    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

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

Similar Threads

  1. Auto Fill
    By Derrick T. Davidson in forum Forms
    Replies: 4
    Last Post: 07-12-2014, 08:19 AM
  2. Replies: 2
    Last Post: 10-23-2012, 12:18 PM
  3. Auto Fill
    By Scotty J in forum Forms
    Replies: 10
    Last Post: 11-21-2011, 10:08 AM
  4. can't auto fill
    By chrisrach3 in forum Access
    Replies: 7
    Last Post: 09-12-2011, 04:41 AM
  5. Auto Fill
    By Kerrydunk in forum Forms
    Replies: 16
    Last Post: 04-26-2011, 12:15 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