M
MAC
Hello,
I can't get the merge procedures (see below) to work in sequence. Am I
placing the conditions in the wrong place? It's only giving the 3 message
boxes for each of the procedures without executing each query for each merge
to Word. What am I doing wrong? Any help appreciated!
I have the following Sub:
Private Sub Command1_Click()
Dim strSql As String
Dim strSq2 As String
Dim strSq2 As String
Dim Update As String
strSq1 = "SELECT * From test WHERE test.Letter1 = true AND test.done =
False"
If Letter1 = True And done = False Then
[execute my "1st Merge procedure"]
Update = "update test set letter1 = True, Done = true where letter1 = True
and Done = False"
CurrentDb.Execute Update
Else
MsgBox ("No one fields to merge for Letter1")
strSq2 = "SELECT * From test WHERE test.Letter2 = true AND test.done =
False"
If Letter2 = True And done = False Then
[execute a "2nd Merge procedure"]
Update = "update test set letter2 = True, Done = true where letter1 = True
and Done = False"
CurrentDb.Execute Update
Else
MsgBox ("No one fields to merge for Letter2")
strSq3 = "SELECT * From test WHERE test.Letter3 = true AND test.done =
False"
If Letter3 = True And done = False Then
[execute a "3rd Merge procedure"]
Update = "update test set letter3 = True, Done = true where letter1 = True
and Done = False"
CurrentDb.Execute Update
Else
MsgBox ("No one fields to merge for Letter3")
End If
End If
End If
I can't get the merge procedures (see below) to work in sequence. Am I
placing the conditions in the wrong place? It's only giving the 3 message
boxes for each of the procedures without executing each query for each merge
to Word. What am I doing wrong? Any help appreciated!
I have the following Sub:
Private Sub Command1_Click()
Dim strSql As String
Dim strSq2 As String
Dim strSq2 As String
Dim Update As String
strSq1 = "SELECT * From test WHERE test.Letter1 = true AND test.done =
False"
If Letter1 = True And done = False Then
[execute my "1st Merge procedure"]
Update = "update test set letter1 = True, Done = true where letter1 = True
and Done = False"
CurrentDb.Execute Update
Else
MsgBox ("No one fields to merge for Letter1")
strSq2 = "SELECT * From test WHERE test.Letter2 = true AND test.done =
False"
If Letter2 = True And done = False Then
[execute a "2nd Merge procedure"]
Update = "update test set letter2 = True, Done = true where letter1 = True
and Done = False"
CurrentDb.Execute Update
Else
MsgBox ("No one fields to merge for Letter2")
strSq3 = "SELECT * From test WHERE test.Letter3 = true AND test.done =
False"
If Letter3 = True And done = False Then
[execute a "3rd Merge procedure"]
Update = "update test set letter3 = True, Done = true where letter1 = True
and Done = False"
CurrentDb.Execute Update
Else
MsgBox ("No one fields to merge for Letter3")
End If
End If
End If