I have some code that will append a new resource if the user selects the yes button on a dialog box. For some reason, nothing happens when the user selects yes. Am i missing a step in my code? For the life of me I cannot see a problem!
Code:
Dim userResponse As Integer
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("SELECT Temp.[Employee/Supplier], Temp.[Bill Rate], MasterCard.Resource " & _
"FROM Temp LEFT JOIN MasterCard ON Temp.[Employee/Supplier] = MasterCard.Resource " & _
"WHERE (((MasterCard.Resource) Is Null));")
Do While Not rs.EOF
userResponse = MsgBox("Do you want to add " & rs![Employee/Supplier] & " to the Master Card?", vbYesNo)
If userResponse = vbYes Then
'Append non exisiting Resource to Rate Card
StrSQL = "INSERT INTO MasterCard ( Resource, [Rate] )SELECT Temp.[Employee/Supplier], Temp.[Bill Rate] " & _
"FROM Temp LEFT JOIN MasterCard ON Temp.[Employee/Supplier] = MasterCard.Resource WHERE Temp.[Employee/Supplier] =' " & rs![Employee/Supplier] & "';"
DoCmd.RunSQL StrSQL
End If
rs.MoveNext
Loop
Is there anything I can do to make this code work? Thank you for your help!