View Single Post
Old 06-01-2017, 12:37 AM   #1
shafara7
Newly Registered User
 
Join Date: May 2017
Posts: 118
Thanks: 23
Thanked 0 Times in 0 Posts
shafara7 is on a distinguished road
Record counter at button Next/Previous

I have a form which shows the task of employees for the whole week and it works like a calendar.
The is a small circle on top of the button Previous and button Next, which shows the number of tasks in the previous and next week.

The problem is, I have to manage the task calendar for 2 site locations.
I only want the calendar to show the task on 1 location, which I just update some values on the related tables.
But the circle that shows the number of tasks for the previous and next week still count for the second location. I have the screenshot attached for reference.

Below is the code for the small circle with number of task..
Code:
Private Sub dotUpdate()
    Dim prv As Integer, nxt As Integer
    prv = DCount("*", "tblMeasurementBill", "IIf(IsNull(.........)")
    nxt = DCount("*", "tblMeasurementBill", "IIf(IsNull(.........)")

    picDotPrev.Visible = (prv <> 0)
    lblDotPrev.value = IIf(prv <> 0, prv, "")
    picDotNext.Visible = (nxt <> 0)
    lblDotNext.value = IIf(nxt <> 0, nxt, "")
End Sub
There is a tblMeasuringEquipment where a field [lngGroup] is assigned to which location it belongs to.
The form Calendar only includes lngGroup which has number 1 - 5, which is the first location.
lngGroup 6 - 10 are for second location, which I don't want to include.

So I tried editing my code to..
Code:
Private Sub dotUpdate()
    Dim prv As Integer, nxt As Integer
    prv = DCount("*", "tblMeasurementBill", "IIf(IsNull(.........)" WHERE tblMeasuringEquipment.lngGroup <6 )
    nxt = DCount("*", "tblMeasurementBill", "IIf(IsNull(.........)" WHERE tblMeasuringEquipment.lngGroup <6 )

    picDotPrev.Visible = (prv <> 0)
    lblDotPrev.value = IIf(prv <> 0, prv, "")
    picDotNext.Visible = (nxt <> 0)
    lblDotNext.value = IIf(nxt <> 0, nxt, "")
End Sub
But it end up not showing anything.
Any idea how the codes should be structured or placed?
Attached Images
File Type: jpg Runde.jpg (51.1 KB, 45 views)

shafara7 is offline   Reply With Quote