Combo box...adding new id for not on list...

dan113999

New member
Local time
Today, 21:17
Joined
Jul 9, 2003
Messages
5
i've checked the Microsoft page on how to add a record to a combo box (http://support.microsoft.com/default.aspx?scid=kb;en-us;161007).

There's one section of the code i'd like to change and i'm not too familiar with coding in Access yet....How would i make this section just 'auto-number' my contact_ID to the next value in my "contact table"?

Here's the code that was given:

' If the user chose to add a new customer, open a recordset
' using the Customers table.
Set Db = CurrentDB
Set Rs = Db.OpenRecordset("Customers", DB_OPEN_TABLE)

' Ask the user to input a new Customer ID.
Msg = "Please enter a unique 5-character" & vbCr & "CustomerID."
NewID = InputBox(Msg)
Rs.FindFirst BuildCriteria("CustomerID", dbText, NewID)
' If the NewID already exists, ask for another new unique
' CustomerID
Do Until Rs.NoMatch
NewID = InputBox("Customer ID " & NewID & " already exists." & _
vbCr & vbCr & Msg, NewID & " Already Exists")
Rs.FindFirst BuildCriteria("CustomerID", dbText, NewID)
Loop
 

Users who are viewing this thread

Back
Top Bottom