Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box Not In List question

Status
Not open for further replies.

Magnetar

Programmer
Sep 22, 2001
73
GB
Afternoon. I have two quick questions, concerning the above event.

The following is part of my code, which allows the user to write a new value to a list (underlying table in Row Source):

.......


MsgBox "This SUBJECT is not on the list. Please press 'Ok' to add. ", vbOKCancel

If vbOK Then

With rstRMIL
.AddNew
!Subject = Me.cboSubject.Text
.Update
End With


.....etc


1. The new value is entered into the table okay, but I obtain an error 2118: 'You must save the current field before you run the requery action'.

2. Does any one know how to disable the following built-in MS Access msge please??:

'The text you entered isn't an item on the list.
Select an item from the list or enter text that matches one of the listed items.'


Any suggestions/hints would be greatly appreciated!!!
ThanX in advance.

Magnetar [cry]
 
Try this:

If vbOk then
With rstRMIL
.AddNew
!Subject = Me.cboSubject.Text
.Update
End With

Response = acDataErrAdded
else
Response = acDataErrContinue
cboYourComboBox.Undo
end if
 
Afternoon.

Many thanX FancyPrairie for your help. Was a little bit uncertain about the (above) two 'event procedure constants', and their usage. But with your suggestions, my code seems to have worked a treat!

Once again, 'hats off' 2 U!

Kind regards

Magnetar [spin]



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top