Working with Combo Box

  • Thread starter Thread starter kuberski
  • Start date Start date
K

kuberski

Guest
This may be a simple fix but, I am new to Access.......

I have a very simple DB which actually has only one table. (Access wizard agrees with this setup) in Access 97. I have created a form which shows all fields including the Customer ID field (Autonumber) and the Customer Name field. The Customer Name is a combo box which lists all the customers names and allows a user to access that record by selecting the name. I have used suggestions found in this forum and have this look up function working by using the AfterUpdate event with code:

Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[ID] = " & Me![Combo36]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

I now have two questions. 1) How do I let a user update the Customer Name field and have the combo box list updated? They can update other fields with no problems. This is so we can reuse Customer IDs. 2) How do I let a user add a new record with a new Company Name and have the combo box add this to its list?

I am not sure if this can be do in the same form or if I need to open another form to do these tasks. Any help is greatly appreciated........

kuberski
 
Thanks, I have some tweaking to do but this seems to get me on the right track to add records. However, Do you have any ideas on how I could update the CompanyName field for a record that already exists? For example, I have some IDs that are already assigned but I have come to know that these customers are no longer with us. I would like to be able to reuse their ID numbers. Therefore, I need to update the info that the combo box is displaying and the solution you gave me only allows me to add new records. Thanks in advance for any help.....

kuberski
 

Users who are viewing this thread

Back
Top Bottom