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

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Triggerin Hide/unhide Field In Access Ds Forms, Access 2016    
 
   
Nak
post Jan 15 2020, 03:02 AM
Post#1



Posts: 71
Joined: 10-January 11



Hi everybody
I have a datasheet form on which we can hide/unhide fields/columns (image1 & 2). How can I trigger any of these 2 events in VBA?
Thanks
Nak
Attached File(s)
Attached File  Image1.png ( 28.29K )Number of downloads: 3
Attached File  Image2.PNG ( 9.43K )Number of downloads: 0
 
Go to the top of the page
 
cheekybuddha
post Jan 15 2020, 05:09 AM
Post#2


UtterAccess Moderator
Posts: 12,621
Joined: 6-December 03
From: Telegraph Hill


Hi Nak,

try:
CODE
  Me.txtSupplier.ColumnHidden = True    '  = False to show again

where txtSupplier is the name of the control that is bound to field Supplier.

hth,

d

--------------------


Regards,

David Marten
Go to the top of the page
 
Nak
post Jan 15 2020, 05:33 AM
Post#3



Posts: 71
Joined: 10-January 11



Thanks cheekybuddha
I guess I didn't formulate my question as I should have!
I need to know the event that is triggered once a user clicks or unclicks the column he wants to hide/show as in the previously attached images.
In other words, how can I identify the column/field the user choses to hide/show?
Thanks
Go to the top of the page
 
June7
post Jan 15 2020, 05:46 AM
Post#4



Posts: 1,315
Joined: 25-January 16
From: The Great Land


If you are looking for an OnHide or OnShow event of controls, I don't see anything like that. KeyUp or MouseUp maybe, but otherwise don't know of any event associated with this action.

This post has been edited by June7: Jan 15 2020, 05:54 AM

--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Go to the top of the page
 
Nak
post Jan 15 2020, 05:52 AM
Post#5



Posts: 71
Joined: 10-January 11



thumbup.gif cheekybuddha

I used your code in a sub as below and it answers my current needs;
Thanks and Best

For I = 0 To Me!SubFormName.Controls.Count - 1
If Me!SubFormName.Controls(I).Section = 0 Then
If Me!SubFormName.Controls(I).ColumnHidden Then
MsgBox "Hidden: " & Me!SubFormName.Controls(I).Name
End If
End If
Next I
This post has been edited by Nak: Jan 15 2020, 05:52 AM
Go to the top of the page
 
Nak
post Jan 15 2020, 05:54 AM
Post#6



Posts: 71
Joined: 10-January 11



I found nothing neither.
Anyway I used the code of cheekybuddha to answer my current needs. I.e. which columns/fields are hidden.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    7th April 2020 - 01:53 AM