M
magmike
I have a control on my form that causes a msgbox to appear before
continuing its action. When "Cancel" is selected, the user gets an
error with a Debug or End choice. I know I left something out - but
can't remember what that is! Here is my code:
Private Sub Command7_Click()
Dim stSQL As String
Dim stControl As String
stSQL = "UPDATE ProspectTable" & _
" SET SelectMe = TRUE" & _
" WHERE EXISTS " & _
"(SELECT *" & _
" FROM SelectionList" & _
" WHERE SelectionList.CompanyID = ProspectTable.ID"
& _
" AND SelectionList.CampID = " & Me.CampID & ")"
stControl = "Company"
Forms!ProspectForm!SelCampID = CampID
DoCmd.RunCommand acCmdRefresh
DoCmd.RunSQL stSQL
DoCmd.GoToControl stControl
'DoCmd.ApplyFilter , "SelectMe = True"
Forms!ProspectForm.RecordSource = "Prospects with SelectMe"
End Sub
continuing its action. When "Cancel" is selected, the user gets an
error with a Debug or End choice. I know I left something out - but
can't remember what that is! Here is my code:
Private Sub Command7_Click()
Dim stSQL As String
Dim stControl As String
stSQL = "UPDATE ProspectTable" & _
" SET SelectMe = TRUE" & _
" WHERE EXISTS " & _
"(SELECT *" & _
" FROM SelectionList" & _
" WHERE SelectionList.CompanyID = ProspectTable.ID"
& _
" AND SelectionList.CampID = " & Me.CampID & ")"
stControl = "Company"
Forms!ProspectForm!SelCampID = CampID
DoCmd.RunCommand acCmdRefresh
DoCmd.RunSQL stSQL
DoCmd.GoToControl stControl
'DoCmd.ApplyFilter , "SelectMe = True"
Forms!ProspectForm.RecordSource = "Prospects with SelectMe"
End Sub