D
deb
How do i alter the below code to insert into the table tSite 2 fields (Site
and CustomerID)
I want to use the Customer ID in the current form(f000Score.CustomerID)
The below code only inserts the field - Site and since CustomerID field is a
required field, it get an error that CustomerID is needed
Private Sub cboSite_NotInList(NewData As String, Response As Integer)
Dim strsql As String, x As Integer
Dim FindCriteria As String
x = MsgBox("Do you want to add this Site to the list?", vbYesNo)
If x = vbYes Then
strsql = "Insert Into tSite ([Site]) values ('" & NewData & "')"
' strsql = "Insert Into tSite ([CustomerID]) values ('" &
[CustomerID] & "')"
'MsgBox strsql
CurrentDb.Execute strsql, dbFailOnError
FindCriteria = Me!cboSite.Text
DoCmd.OpenForm "fSiteNotInList", , , , , , FindCriteria
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
End Sub
thanks
and CustomerID)
I want to use the Customer ID in the current form(f000Score.CustomerID)
The below code only inserts the field - Site and since CustomerID field is a
required field, it get an error that CustomerID is needed
Private Sub cboSite_NotInList(NewData As String, Response As Integer)
Dim strsql As String, x As Integer
Dim FindCriteria As String
x = MsgBox("Do you want to add this Site to the list?", vbYesNo)
If x = vbYes Then
strsql = "Insert Into tSite ([Site]) values ('" & NewData & "')"
' strsql = "Insert Into tSite ([CustomerID]) values ('" &
[CustomerID] & "')"
'MsgBox strsql
CurrentDb.Execute strsql, dbFailOnError
FindCriteria = Me!cboSite.Text
DoCmd.OpenForm "fSiteNotInList", , , , , , FindCriteria
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
End Sub
thanks