Binding Label controls to data

MS Office Access

    Next

  • 1. MsgBox entering the correct info
    Hi all, I want to create a MsgBox pop up on the Form with a logic between two fields. DateClosed and Disposition. Here is the logic: If there is a DateClosed entered, the user must fill out the Disposition field. I placed the code on Exit Event Procedure of Disposition field. If the user place the cursor on Disposition field and tried to skip it without filling it out, he gets the MsgBox telling to fill out the field, but the Msg pop up do not shows up if the user skips the Disposition field and closes the form. How can I make the user fill out the disposition field if he enters DateClosed? Is there any way to check if the DateClosed is filled out and Disposition is left blank the user has to fill out Disposition otherwise he can not move to the next record. Thank you Bob
  • 2. Disable Esc Key in a Form
    Hi: How can i disable Esc key in a Form. Thanks.
  • 3. fill combobox from selection from another
    i need to fill a city and a county combobox once the user selects a state. how to with VBA and/or query? tia, mcnewsxp
  • 4. Combo box Limit
    Hello everyone, I have a drop down combo box list in Access 97 that is supposed to contain all the values based on a query; however, certain values are not showing up in the combo drop down list. The query which is the source of the combo box drop down list has over 70,000 values but not all values are showing up. The query is a simple query and it is working fine. Under Tools -> Options -> Edit/Find tab the "Don't display lists where more than this number of records read" set to 30,000; however, I cannot significantly increase this value. Is there any way to ensure that the combo drop down list will contain all 70,000 values (and many more in the future)? Thanks, Joey

Binding Label controls to data

Postby fryere » Thu, 07 Aug 2003 05:39:37 GMT

I am trying to use label ctrls to represent data in a 
table. Each ctrl would represent one record. 
Here is a Table layout:
    lblName Test
    XPos    Single  
    YPos    Single

I will have a label ctrl for each Record, and I want to 
loop through the record set and set each lbl ctrl to the 
X&Y position in the table.  My Problem is that the only 
way I can make it work is by looping through all of the 
controls until the ctrl.name =RS!lblname for each record 
in the table. I would like set up a control varible and 
somehow set it to the current record in the record set.
BTW: Creating new controls with Createcontrol() won't work 
because I need code for an on click event. Unless someone 
knows how to create code on the fly.

Any help would be greatly appreciated.
fryere

Re: Binding Label controls to data

Postby fryere » Thu, 07 Aug 2003 20:12:53 GMT

Thanks Marshall,
   Found it last night. Thanks for replying.

fryere


Similar Threads:

1.Moving focus from bound control to unbound control causes bound control changes to be cancelled

How can I trap this and keep it from happening?

2.Source Control data binding to ActiveX control property

A third-party ActiveX control ctDropDrop has an integer Value property that 
is the number of days from 1/1/1900, and my table has a field ScheduleDate 
with type Date.  Can I use a form's Source Control to bind Value to 
ScheduleDate, perhaps using conversion routines, or do I use event 
procedures to copy the date from/to the form text box and ActiveX property 
value?  I'm guessing the answer is the latter, but want to make sure I'm 
using the simple approach.

Best,
Christopher


3.Code to refer to the caption of a label bound to a control

I use controlstag property and BeforeUpdate code to validate missing data 
on a form. How can I edit the MsgBox below to show the caption of the label 
that bound to the control, instead the name of the control (ctl.Name) 
that currently used? Thanks. - Kurt

###

Private Sub Form_BeforeUpdate(Cancel As Integer)

Dim ctl As Control

    For Each ctl In Me
         
        If ctl.Tag = "*" Then
            If IsNull(ctl) Or ctl = "" Then
                MsgBox "You must complete the required field '" & " " & 
ctl.Name & " " & "' before you can continue.", vbCritical, "Required Field"
                ctl.SetFocus
                Cancel = True
                Exit Sub
            End If
        End If
    Next
    Set ctl = Nothing

End Sub

4.Bound Control - make respective label use field desc

I have a form with bound controls with respective labels.

Each text box is name "txt"+Data Source Name (field name)

Each respective label in captioned as "lbl"+Data Source Name

I would like to loop through the form, grab the text box's data source
property and set it's corresponding label's caption property to the data
source property.

Any ideas?

Thanks.



5.To control textbox according to label values ( label should be controlled from another textbox )

Hi,
     I want to link textbox and label in access report. I am making a
report in which i want fields value in Week 1 to Week52 to be
coloured
according to field value in WEEK. If WEEK value is 45 them all fields
from Week1 to Week45 should be coloured if they have some value.

WEEK (LABEL)    ___any value say 45_____(TEXTBOX)


1 (LABEL)         should be coloured if label value is =or less than
WEEK text value and textbox
                        of 1 is not empty. (can have value say H, M ,
W etc.)
2                       should be coloured if label value is =or less
than WEEK text value and textbox
                         of 2 is not empty
3                                         -
4                                         -
-
-
45                     should be coloured if label value is =or less
than WEEK text value and textbox
                         of 45 is not empty

-
-
52                     So values upto 1 to 45 should be coloured in
report if not empty.


                        Can anyone help me regarding this problem.




6. Format record bound charts in Access, data labels and colors

7. Label Bound to another Label

8. Non-bound control on bound-form



Return to MS Office Access

 

Who is online

Users browsing this forum: No registered users and 79 guest