Make text box automatic, based on drop-down menu

Anonymous
2011-03-21T18:06:56+00:00

I am using Microsft Access 2007.  I have a form that has a drop-down menu to select a customer from a separate table.  I have a text box next to it for the part number, and another text box next to that for the program number.  The P/Ns are specific to each customer.  So, I would like to make it such that, in this form, when a customer is selected from the menu, the P/Ns automatically generate.  How can this be done?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

45 answers

Sort by: Oldest
  1. Anonymous
    2011-03-24T21:02:34+00:00

    But I do still want everything to be recorded in the back-end Table.  I want to have all of the relevant working information recorded in one place.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2011-03-24T21:28:58+00:00

    You put [Event Procedure] in the combo box's AfterUpdate event property.

    The line of code goes in the combo box's AfterUpdate event procedure in the form's module.

    There are a gazillion normalization articles out on the web and the wikipedia one is a decent place to start.  I kind of like an ad hoc explanation I heard many years ago:  When you change any data value, you should only have to modify one field in one record in one table!  Clearly putting your PN in two tables is a violation.  On the other hand, and this is not carte blanc to ignore the rules, there are rare occasions when practical issues such as performance when it is necessary to break the rules.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2011-03-25T11:10:24+00:00

    I'm not putting the same data in two tables.  I have one table that has a record of the programs, with their respective P/Ns next to them.  Then, I have another Table with each produced unit, with their corresponding customer/program and P/Ns.  I know that the Customer/program and P/Ns are recorded in two places, and I could use a query to match it all up, but that's not what I'm asked for.  Unless there's a way to make that still go to a Table, but as I'm understanding, that's not how it really works.

    also, using the AfterUpdate procedure,

    Option Compare Database

    Private Sub Combo69_AfterUpdate()

    Me.[Part Number] = Me.Combo69.Column(1)

    Me.[____ P/N] = Me.[Combo69].Column(2)

    End Sub

    doesn't seem to do anything for what I want to accomplish, if anything at all

    Was this answer helpful?

    0 comments No comments
  4. ScottGem 68,840 Reputation points Volunteer Moderator
    2011-03-25T12:59:20+00:00

    I'm not putting the same data in two tables.  I have one table that has a record of the programs, with their respective P/Ns next to them.  Then, I have another Table with each produced unit, with their corresponding customer/program and P/Ns.  I know that the Customer/program and P/Ns are recorded in two places, and I could use a query to match it all up, but that's not what I'm asked for.

    Marshall said it previously, but I'll reiterate. USERS DO NOT DICTATE TABLE DESIGN! If a user is asking you for a table, then you ask them what is it they want to see. And you give them what they want to see. Users DO NOT get to see or interface directly with tables. They interface through forms, reports and queries.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2011-03-25T13:05:45+00:00

    Right, but it does still make logical sense to record all three values, as they have been known (infrequently) to change over time.

    Was this answer helpful?

    0 comments No comments