JamesMcS
Keyboard-Chair Interface
- Local time
- Today, 02:16
- Joined
- Sep 7, 2009
- Messages
- 1,819
So then, yet another odd one - I've got this form, image attached. As you can see there are a number of check boxes to the left, these are used to 'tag' a particular record for including in reports etc.
The text boxes at the top are supposed to sum up the sales figures for those records that are tagged, example control source would be:
I've labelled the field AEM CY-1 on the image. In the on click of the check box I've got
Each of the summing-up text boxes has a tag that includes "Totals". So the goal is that every time you click a tagged check box, the totals change to reflect what you've selected. Now for the strange bit: the change in totals seems to be one click behind what you're clicking - i.e. if you uncheck the first row, nothing happens. If you uncheck the second row, the totals reduce by the amount of the first row, and so on - no matter what order you check/uncheck them in, it's always one behind.
Also, super weirdly, check box in the header row executes the following code:
And this, despite not requerying the controls, has an immediate effect on the total boxes.
"Me.Requery" works fine in the tagged check box's on click. Unfortunately it also has the disadvantage of moving the form back to the top, which I don't want it to do.
Any ideas?? I think this one is worthy of a
The text boxes at the top are supposed to sum up the sales figures for those records that are tagged, example control source would be:
Code:
=Sum(IIf([Tagged]=-1,[AEM CY-1],0))
Code:
Private Sub Tagged_Click()
For Each Control In Me.Controls
If InStr(Control.Tag, "Totals") Then
Control.Requery
End If
Next
End Sub
Also, super weirdly, check box in the header row executes the following code:
Code:
Sub TagAll(Called_From As Form)
Dim Rst As DAO.Recordset
Set Rst = Called_From.Recordset
Rst.MoveFirst
Do Until Rst.EOF
Rst.Edit
If Called_From.Tag_All.Value = -1 Then
Rst.Fields("Tagged") = -1
Else
Rst.Fields("Tagged") = 0
End If
Rst.Update
Rst.MoveNext
Loop
Rst.MoveFirst
End Sub
"Me.Requery" works fine in the tagged check box's on click. Unfortunately it also has the disadvantage of moving the form back to the top, which I don't want it to do.
Any ideas?? I think this one is worthy of a
Attachments
Last edited: