updating

teiben

Registered User.
Local time
Today, 22:24
Joined
Jun 20, 2002
Messages
462
I have a form with a combo box. If the supplier(s) name is not in the combo box, it asks do you want to add that supplier address? If yes, a popup form displays, where the name and address are entered. THis updates the table. But the problem is the combobox doesn't refresh so the user isn't aware that it has updated.

I've tried updating the form, but that results in the question being asked again, do you want to add that supplier address.

Here is my code

Dim intNewCategory As Integer, intTruncateName As Integer, strTitle As String, intMsgDialog As Integer

' Display message box asking if user wants to add a new category.
strTitle = "Shipper Database"
intMsgDialog = vbYesNo + vbQuestion + vbDefaultButton1
intNewCategory = MsgBox("Do you want to add this Company and Address to the List?", intMsgDialog, strTitle)

If intNewCategory = vbYes Then
' Remove new name from CategoryID combo box so
' control can be requeried when user returns to form.
'DoCmd.RunCommand acCmdUndo

' Display message box and adjust length of value entered in
' CategoryID combo box.
strTitle = "Name Too Long"
intMsgDialog = vbOKOnly + vbExclamation
If Len(NewData) > 50 Then
intTruncateName = MsgBox("Name of the Supplier can be no longer than " _
& "50 characters. The name you entered will be truncated.", _
intMsgDialog, strTitle)
NewData = Left(NewData, 50)
End If
 
I'm guessing this is in the NotInList event?

Code:
Response = acDataErrAdded
 

Users who are viewing this thread

Back
Top Bottom