UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Trouble with a Label    
 
   
Vongalin
post Feb 8 2009, 05:31 PM
Post #1

UtterAccess Member
Posts: 47



Hello all. In an attempt to create a "larger" checkbox I am working with code that I found here. Basically it hides the checkbox and switches the value and caption when you click a label (to WingDings chr(252)). The problem I am having is - regardless of the value of the checkbox, the label is the same for all the records on the form.

lblMON is a static label that shows the day of the week (Mon, Tue, etc.)
chkMONPD is bound to the table (for a yes/no field)
lblMONPD is the label to show the fancy checkmark. NOTE : I have a different label for each day, lblTUEPD, etc. The following example is for a Monday.

The OnClick for the lblMONPD label is this:
CODE
Call CheckPD("MON")

which calls this:
CODE
Private Sub CheckPD(strDay)
    Me.Controls("chk" & strDay & "PD") = Not Me.Controls("chk" & strDay & "PD")
    If Controls("chk" & strDay & "PD") = True Then
        Controls("lbl" & strDay & "PD").Caption = Chr(252)
    Else
        Controls("lbl" & strDay & "PD").Caption = " "
    End If
End Sub

and this is the OnCurrent for the form:
CODE
    Dim arrDays
    Dim strDay
    
    arrDays = Array("MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN")

    For Each strDay In arrDays
        If IsNull(txtNumber.Value) Then
            Me.Controls("lbl" & strDay & "PD").Visible = False
        Else
            Me.Controls("lbl" & strDay & "PD").Visible = True
            If Me.Controls("chk" & strDay & "PD") = True Then
                Me.Controls("lbl" & strDay & "PD").Caption = Chr(252)
            Else
                Me.Controls("lbl" & strDay & "PD").Caption = " "
            End If
        End If
    Next

Is it not possible to have a different caption for the label for each record ?
Go to the top of the page
 
+
Bob_L
post Feb 9 2009, 01:51 AM
Post #2

Utterly Banned
Posts: 7,038



Not on a continuous form. If you want that then you will need to include a field to store the results for each record and then use a text box Formatted to LOOK like a label.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 18th June 2013 - 03:57 PM