C
CJ
Hi Groupies:
The standard Not In List code that I use is something like:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strMsg As String
strMsg = strMsg & "Add " & NewData & " to the list?"
If MsgBox(strMsg, vbQuestion + vbYesNo, "Item Not Available") = vbNo
Then
Response = acDataErrContinue
Else
Set db = CurrentDb
Set rs = db.OpenRecordset("tblProducts", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!lngProductID = NewData
rs.Update
If Err Then
MsgBox "An error occurred. Please try again."
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
End If
However, I need to know how to add 2 values to the table instead of just 1.
For example: I have lngProductID and strProductName that I would like to add
via VB.
Can somebody please help me out with this before I pull the rest of my hair
out?
The standard Not In List code that I use is something like:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strMsg As String
strMsg = strMsg & "Add " & NewData & " to the list?"
If MsgBox(strMsg, vbQuestion + vbYesNo, "Item Not Available") = vbNo
Then
Response = acDataErrContinue
Else
Set db = CurrentDb
Set rs = db.OpenRecordset("tblProducts", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!lngProductID = NewData
rs.Update
If Err Then
MsgBox "An error occurred. Please try again."
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
End If
However, I need to know how to add 2 values to the table instead of just 1.
For example: I have lngProductID and strProductName that I would like to add
via VB.
Can somebody please help me out with this before I pull the rest of my hair
out?