E
esee
The AfterUpdate Event for a control cboName is NOT updating another
control txtCurTotals on the same form.
What's wrong?
The control txtCurTotals has the following Control Source:
="Current Selections = " & [TotalCount]
TotalCount: DCount("Ingredient","zIngredientAndLocation","[NeedIt] =
True")
Private Sub cboName_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = Me.Recordset.Clone
rs.FindFirst "[IngredientID] = " & Me![cboName]
If rs.NoMatch Then
MsgBox "Record not found"
Else
Me.Bookmark = rs.Bookmark
Me.NeedIt.Value = True
Me.Refresh
End If
rs.Close
Set rs = Nothing
End Sub
control txtCurTotals on the same form.
What's wrong?
The control txtCurTotals has the following Control Source:
="Current Selections = " & [TotalCount]
TotalCount: DCount("Ingredient","zIngredientAndLocation","[NeedIt] =
True")
Private Sub cboName_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = Me.Recordset.Clone
rs.FindFirst "[IngredientID] = " & Me![cboName]
If rs.NoMatch Then
MsgBox "Record not found"
Else
Me.Bookmark = rs.Bookmark
Me.NeedIt.Value = True
Me.Refresh
End If
rs.Close
Set rs = Nothing
End Sub