Edit a Record

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ChaseCox
    Contributor
    • Nov 2006
    • 293

    Edit a Record

    Hi everyone,

    I am working on a new database and this one is slightly different than what I have done. I now need to be able to manipulate the information in a table. What I would like to do is be able to select a physical part (TV, Computer, ect) from a drop down box (I have this working) and based on what I select be able to populate several more boxes on the form with that parts information. For Example:

    If I were to select TV from the Combo Box, I would like the other boxes to be filled in with the TV's Cost (in one box), date purchased (in another box), part number (in another box)...

    I would then like to be able to update some of the information and then save it back into the database, updated. It is not nescessary to keep the previous information.

    I hope this is clear enough.

    Any help would be greatly appreciated.

    Thanks
  • Stang02GT
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    If you check out this website i think it will guide you in the right direction!



    http://www.mvps.org/access/forms/frm0028.htm

    Comment

    • ChaseCox
      Contributor
      • Nov 2006
      • 293

      #3
      Thanks for the reply, But I don't think that is going to do what I want.

      For Example if I had selected the part in the table, I would like the other boxes to show the related information and allow me to update them. It seems like that link you posted is only going limit the options in the box.

      Comment

      • ChaseCox
        Contributor
        • Nov 2006
        • 293

        #4
        Nevermind I think this will work, do you have any idea about how to have the value sho in the box, and not just in the list?

        Comment

        • ChaseCox
          Contributor
          • Nov 2006
          • 293

          #5
          sorry about that. I figured that out too. Thanks for the help Stang.

          Comment

          • ChaseCox
            Contributor
            • Nov 2006
            • 293

            #6
            Thought I might share my solution to the problem:

            For my case, Inventory is the table, and ProductNumber is the field I am concerned with (column heading in table).

            I then needed to relate the field I am wanting information about to the input from the combo box. That is what I am doing here:
            Code:
            "[Product] = cmb12.value"
            So for example if I typed in TV to the combo box, the combo box would display the appropriate Product Number.

            The following is the actual code I inserted in the Form:

            Code:
            Private Sub cmb12_AfterUpdate()
            
            Dim varx As Variant
            
            varx = DLookup("[ProductNumber]", "Inventory", "[Product] = cmb12.value")
            cmb13 = varx
            
            Me!cmb13.Requery
            
            End Sub

            Comment

            • Stang02GT
              Recognized Expert Top Contributor
              • Jun 2007
              • 1206

              #7
              Thank you for sharing! I'm glad you were able to solve your problem

              Comment

              Working...