Hey guys, first of all i am a student. I have done some work on databases using Oracle but im completely new to Access so please bare with me. Also im nor sure if im in the right forum but here is my issue.
I have a subform called product catalogue. It links to a form that is populated by a table containing productID,description,price etc.
I have created a combo box that displays all of the product information from the table for each record at a time e.g 1(productID),Spanner(description),4.18(price) etc.
What i want to do is when the user goes through the combo box and chooses the product they want, once they select it all of the information from the combo box goes to its cooresponding cell in the sub form.
So for example is they chose 1,Spanner,4.18. The boxes in the form would populate: ProducctID - 1, Description - Spanner, Price - £4.18.
I have a VBA access for dummies book and i found a section that i thought would help me. I used the following code which should have worked for what i want. Here is the code.
However the combo box still doesnt populate the form for me. Is there anyway i can do this?
Thanks in advance!
I have a subform called product catalogue. It links to a form that is populated by a table containing productID,description,price etc.
I have created a combo box that displays all of the product information from the table for each record at a time e.g 1(productID),Spanner(description),4.18(price) etc.
What i want to do is when the user goes through the combo box and chooses the product they want, once they select it all of the information from the combo box goes to its cooresponding cell in the sub form.
So for example is they chose 1,Spanner,4.18. The boxes in the form would populate: ProducctID - 1, Description - Spanner, Price - £4.18.
I have a VBA access for dummies book and i found a section that i thought would help me. I used the following code which should have worked for what i want. Here is the code.
Code:
Private Sub GoToProduct_AfterUpdate()
'clone the forms table into a recordset.
Dim MyRecSet As Object 'declare object
Set MyRecSet = Me.Recordset.Clone 'clone Product Table
'find first matching record in the recordset.
MyRecSet.FindFirst "[ProductID]" = " & Me![GoToProduct]"
'Set the forms record to found record
Me.Bookmark = MyRecSet.Bookmark
End Sub
Thanks in advance!
Last edited: