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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data won't refresh or requery??

Status
Not open for further replies.

daniels012

Technical User
Jan 19, 2005
55
US
I can get all the way through adding a new product, then the data will not update in my combo button. Here is the code:

Private Sub ProductID_NotInList(NewData As String, Response As Integer)
If MsgBox("The Product " & NewData & " you entered, does not exist yet." & vbCrLf & vbCrLf & "Do you wish to add it?", _
vbQuestion + vbYesNo) = vbYes Then
Response = acDataErrContinue
DoCmd.OpenForm "AddNewProductsFrm", acNormal, , , acFormAdd, , NewData
Else
Response = acDataErrAdded
ProductID.Undo
DoCmd.Save
ProductID.Requery
End If
End Sub

Any help would be greatly appreciated,
Michael
 
Reread carefully the VBA help for the NotInList event.
Anyway the AddNewProductsFrm form must be opened with WindowMode:=acDialog to pause the current code.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
How are ya daniels012 . . . . .

Thats:
Code:
[blue]DoCmd.OpenForm "AddNewProductsFrm", acNormal, , , acFormAdd, [purple][b]acDialog[/b][/purple], NewData[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top