Minggu, 05 Oktober 2014

Re: [MS_AccessPros] fields visible if not null

 

Hi Luigi,

adding on to what John said ... if any of the labels do NOT disappear with the corresponding control, they need to be associated.  You can do this by:

1. cut the label
2. select the control you want to associate it with
3. paste
4. reposition

I have also been told that you can drag a label over a control to associate it but I haven't tried that myself

Warm Regards,
Crystal

Popup Calendar that works with Access 2007 and above
Popup Calendar for Access 2007 and above

 *
   (: have an awesome day :)
 *



On Sunday, October 5, 2014 4:30 AM, bondurri. luigi <no_reply@yahoogroups.com> wrote:




your second name is CODE!
Thanks
Luigi


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Luigi-

Sure!

Dim ctl As Control
    ' Loop through all controls on the form
    For Each ctl In Me.Controls
        ' First, make it visible
        ctl.Visible = True
        ' Check the ControlType
        Select Case ctl.ControlType
            ' Check any control that contain a value
            Case acCheckBox, acComboBox, acListBox, acOptionButton, acTextBox, acToggleButton
                If IsNull(ctl.Value) Then ctl.Visible = False
        End Select
    Next ctl


You don't need to check labels (unless you're interested in the Caption property) as long as labels are all attached correctly to the related editable control.  When you set the control Visible = False, the attached label should disappear, too.


John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Oct 5, 2014, at 10:34 AM, bondurri.luigi <no_reply@yahoogroups.com> wrote:

Hi all, I'm trying to show in a form, fields (and labels) only if they are not null.
field by field I can do in this way:
____________________________
Private Sub Form_Current()
'If IsNull(FIELD1) Or FIELD1= "" Then
'    FIELD1.Visible = False
Else
     FIELD1.Visible = True
end If
end sub
____________________________
there is the possibility in your opinion to let MSaccess check on current event ALL fields in the form and apply the visible property if each field is not null?

Thanks for your support
Luigi
 





__._,_.___

Posted by: Crystal <strive4peace2008@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

.

__,_._,___

Tidak ada komentar:

Posting Komentar