G
Guest
With the following code (stripped of unnecessary? detail), I am looking to
update the PrintLabel field.
The message proves that the code is getting to rs1.Edit 4 times - but the
field value in the table remains as false.
I've spent hours on this, just as well it's volunteer work.
Private Sub btnGo_Click()
Dim rs1 As DAO.Recordset
Dim sSQL As String
sSQL = "SELECT tAddress.AddressID, tAddress.Active, tAddress.PrintLabel,
tCategory.* " _
& "FROM tAddress INNER JOIN tCategory ON tAddress.AddressID =
tCategory.AddressID "
If Me.Controls("chkActive").Value = -1 _
Then
sSQL = sSQL & "WHERE (((tAddress.Active)=True));"
Else
sSQL = sSQL & "WHERE (((tAddress.Active)=False));"
End If
Set rs1 = CurrentDb.OpenRecordset(sSQL)
With rs1
Do Until .EOF
If <value found in tCategory> = True _
Then
MsgBox "found"
rs1.Edit
!PrintLabel = True
End If
.MoveNext
Loop
.Close
End With
Set rs1 = Nothing
'fnCreateLabels
End Sub
update the PrintLabel field.
The message proves that the code is getting to rs1.Edit 4 times - but the
field value in the table remains as false.
I've spent hours on this, just as well it's volunteer work.
Private Sub btnGo_Click()
Dim rs1 As DAO.Recordset
Dim sSQL As String
sSQL = "SELECT tAddress.AddressID, tAddress.Active, tAddress.PrintLabel,
tCategory.* " _
& "FROM tAddress INNER JOIN tCategory ON tAddress.AddressID =
tCategory.AddressID "
If Me.Controls("chkActive").Value = -1 _
Then
sSQL = sSQL & "WHERE (((tAddress.Active)=True));"
Else
sSQL = sSQL & "WHERE (((tAddress.Active)=False));"
End If
Set rs1 = CurrentDb.OpenRecordset(sSQL)
With rs1
Do Until .EOF
If <value found in tCategory> = True _
Then
MsgBox "found"
rs1.Edit
!PrintLabel = True
End If
.MoveNext
Loop
.Close
End With
Set rs1 = Nothing
'fnCreateLabels
End Sub