Undo Itemcode

S

SG

I have the following behind a list box on a subform but it does not see to be working the vbNo section, if I select No the itemcode which the user typed in should be undone but nothing is happening any ideas anyone??




Private Sub itemcode_NotInList(NewData As String, Response As Integer)


If MsgBox("The Itemcode cannot be found enter now?", _
vbYesNo) = vbYes Then
DoCmd.OpenForm "enter new product details", , , , acFormAdd, acDialog, NewData
Response = acDataErrAdded

If vbYesNo = vbNo Then
Me.Undo
Cancel = True

Else
Response = acDataErrContinue
End If

End If

End Sub



Many Thanks


S
 
S

SG

Damian,

Perfect - Thankyou

If I answer yes the the question how can I copy the itencode typed in by the
user and have this displayed in the itemcode field of the "Enter New Product
Details" form to avoid the user having to type the itemcode again?

Thanks for the help!

S
 
D

Damian S

Hi again SG,

Depending on where else you can open the add item form from, you could pass
the value as a parameter to the form, or you could have an on open event that
grabs the value from your other form eg:

me.txtItemCode = forms!OTHERFORM.ItemCode

Hope this points you in the right direction.

Damian.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

NotInList Firing Problem 17
Rename Message Box 3
Cbo Not In List code error 9
MsgBox 9
NotInList Issue 1
Not in list warning 2
NotInList not firing ? 2
Not in list warning 2

Top