Dynamic controls.. (1 Viewer)

GUIDO22

Registered User.
Local time
Today, 15:33
Joined
Nov 2, 2003
Messages
515
I wish to create a form for the user to hide customers from a panel.
On load, The dialog to do this will populate with checkbox rows according to the number of customers returned from an sql query.
Any helpful code snippets to dynamically add the checkbox controls would be appreciated.
Thank you in advance
 

GinaWhipp

AWF VIP
Local time
Today, 11:33
Joined
Jun 21, 2011
Messages
5,901
Hmm, going to need a wee bit more information...

Hide customers based on what? And who are you hiding them from? What if you need them back?
 

GUIDO22

Registered User.
Local time
Today, 15:33
Joined
Nov 2, 2003
Messages
515
The primary panel shows work in progress but is busy with many records. I want to give the user the facility to hide certain customers to reduce 'clutter' on the form particularly where certain contacts have been on hold for prolonged periods...
The customer Id will be stored with the user profile to maintain the hidden status between logins.

If I need them back..? Unticking the checkbox on this filter form, and apply the change will redraw the primary panel, calling the sql again for the dataset to include the relevant customers that are ticked. That's it!
 

GinaWhipp

AWF VIP
Local time
Today, 11:33
Joined
Jun 21, 2011
Messages
5,901
So perhaps you want a Filter (combo box) at the top to...

Show All
Show Between From Date and To Date
Show On Hold
etc...

Does make for less clicking if the list is kind of long.
 

GUIDO22

Registered User.
Local time
Today, 15:33
Joined
Nov 2, 2003
Messages
515
Not really, the list will only show unique customer names .. I specifically want checkbox selection as stated...
or alternative toggle on/off method as stated actioned from a modal filter form/dialog box...
 

jdraw

Super Moderator
Staff member
Local time
Today, 11:33
Joined
Jan 23, 2006
Messages
15,364
Can you quantify the issue? How may Customer records are returned from "sql query"? How many constitute"clutter"?
Do you have any forms with sample data to assist readers to understand your situation? As Gina suggested, a combobox to Filter/hide records seems practical, but you seem focused on Checkbox--- do you have some rationale for Checkbox specifically?

Update: Ken Sheridan has an answer to a similar "opportunity" here. You may be able to adapt to your needs. Good luck.
 
Last edited:

GPGeorge

Grover Park George
Local time
Today, 08:33
Joined
Nov 25, 2004
Messages
1,776
Actually, toggling OFF the visibility of records in a continuous view form might not be all that hard, and I'm sure one of the Coder Pros here will have a sample soon. What's going to be interesting is getting them BACK into view once you hide them --- and the checkbox belonging to them. :unsure:
 

bastanu

AWF VIP
Local time
Today, 08:33
Joined
Apr 13, 2010
Messages
1,401
You need to have a yes\no field in the source table (I think you already do as you mention OnHold). Use that in your form bound to the checkbox and in the AfterUpdate of the checkbox do a requery (assuming the form is bound to a query that hides the holds).

Cheers,
 

GinaWhipp

AWF VIP
Local time
Today, 11:33
Joined
Jun 21, 2011
Messages
5,901
Actually, toggling OFF the visibility of records in a continuous view form might not be all that hard, and I'm sure one of the Coder Pros here will have a sample soon. What's going to be interesting is getting them BACK into view once you hide them --- and the checkbox belonging to them. :unsure:
And that was my initial thought. They're hidden, how are you going to get them back without some other toggle.
 

bastanu

AWF VIP
Local time
Today, 08:33
Joined
Apr 13, 2010
Messages
1,401
With a simple button "Show All" that runs an update query to set the IsVisible (or OnHold) to False then do a requery.

Cheers,
 

GPGeorge

Grover Park George
Local time
Today, 08:33
Joined
Nov 25, 2004
Messages
1,776
With a simple button "Show All" that runs an update query to set the IsVisible (or OnHold) to False then do a requery.

Cheers,
That'll do it, of course. But the request was for checkboxes....
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 11:33
Joined
May 21, 2018
Messages
8,463
You need to have a yes\no field in the source table
@GUIDO22 This is the easiest way to do as was suggested. If you do not want to add the field then you need to add a table and store your selections in another table. Pretty easy interface to hide selected, show only selected, or show all. I think people are over thinking it.
 

Attachments

  • ShowHide.accdb
    556 KB · Views: 193

Users who are viewing this thread

Top Bottom