• Entering data using combo boxes (Access XP)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Entering data using combo boxes (Access XP)

    Author
    Topic
    #409706

    I have set up a form to enter data. It contains combo boxes (drop down lists), labels that come up based on what the user selects in the combo box, as well as text boxes which the user types in. I would like the information the user selects and enters on the form to add a new record into a table. Right now all the information that the user types into the text boxes is added but the information that the user selects using combo boxes does not appear in the record. How can I make this information add into the record. (I’ve attached a couple of screenshots)

    Thanks in advance for your help

    Viewing 1 reply thread
    Author
    Replies
    • #875248

      In the design view of the form, select a combobox. Open the property window and select the tab Data.
      The first line, the Control Source property, should contain the name of the field where the data from the combobox should be stored.
      You can click on the down arrow on the right to select a field.

      • #875281

        I think I needed to provide more information in my original post. Sorry. Selecting the control source doesn’t work and I think it’s because I already have a control source for the Product ID “label” which is vb “event” that fills in this field when the user makes a selection in the Products combo box. When I put in a control source on the Products combo box this event no longer works. I’ve attached a zip file of the actual database I’m working with if that helps.

        Thanks,

        • #875333

          I have modify your db as follow :
          In table Inventory Transactions
          -Delete field description
          -Set length of field ProductID to 31 (same as in table inventory)
          -add field CategoryID
          In form Categories and Products
          -Combo Categories : set control source to categoryID, in after update add code to requery combobox Products
          -In On Current event of the form add code to requery combobox Products
          -In Combo Products Row Source change criteria for CategoryID to [forms]![categories and products]![categories] and Control Source to ProductID
          -In Combo EmployeeID set Control Source to EmployeeID

          • #875421

            Thanks. I need to report on the information that goes into the inventory transaction table and in the report I would like to show the Product Description and the Employee name rather than the Product ID and the Employee ID. Is there an easy way to do this?

            Thanks.

            • #875449

              As you ask me that, I discover another error in the tables.
              In the table Inventory Transactions the field EmployeeID should be a Number Long Inter type. You’ll have to remove the relation to change this. After the change, recreate the relation.
              For the report, create a query like in the attachment, add more fields if needed and use this query as record source for the report.

            • #875450

              As you ask me that, I discover another error in the tables.
              In the table Inventory Transactions the field EmployeeID should be a Number Long Inter type. You’ll have to remove the relation to change this. After the change, recreate the relation.
              For the report, create a query like in the attachment, add more fields if needed and use this query as record source for the report.

          • #875422

            Thanks. I need to report on the information that goes into the inventory transaction table and in the report I would like to show the Product Description and the Employee name rather than the Product ID and the Employee ID. Is there an easy way to do this?

            Thanks.

        • #875334

          I have modify your db as follow :
          In table Inventory Transactions
          -Delete field description
          -Set length of field ProductID to 31 (same as in table inventory)
          -add field CategoryID
          In form Categories and Products
          -Combo Categories : set control source to categoryID, in after update add code to requery combobox Products
          -In On Current event of the form add code to requery combobox Products
          -In Combo Products Row Source change criteria for CategoryID to [forms]![categories and products]![categories] and Control Source to ProductID
          -In Combo EmployeeID set Control Source to EmployeeID

      • #875282

        I think I needed to provide more information in my original post. Sorry. Selecting the control source doesn’t work and I think it’s because I already have a control source for the Product ID “label” which is vb “event” that fills in this field when the user makes a selection in the Products combo box. When I put in a control source on the Products combo box this event no longer works. I’ve attached a zip file of the actual database I’m working with if that helps.

        Thanks,

    • #875249

      In the design view of the form, select a combobox. Open the property window and select the tab Data.
      The first line, the Control Source property, should contain the name of the field where the data from the combobox should be stored.
      You can click on the down arrow on the right to select a field.

    Viewing 1 reply thread
    Reply To: Entering data using combo boxes (Access XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: