Disclaimer: I am Not any sort of a coding expert or professional, just a 64 yo volunteer at a Museum,
helping them keep a Truck Show Charity Event in order. Meagre knowledge of Excel and Access.
I have a Form containing 57 text boxes (and others), laid out as a full page menu system. (image below)
Clicking on any of these 57 sends a report on the Category Clicked, to either the Printer or Screen.
Coding 57 separate [Private Sub Text1_Click()] macros seems extremely inefficient and time consuming.
[image]
[/image]
I had an idea that something like the snippet below might work, but lack the knowledge to proceed:
All the controls involved have the same names (e.g. "Title1", Title2" ... as do their labels and counters.
[Make] is a field inherited from the Source Query
I've purposely Commented-Out the codelines, knowing they aren't operational
Code:
'MakeVar = Array(0, 26, 21, 8, 11, 14, 13, 15, 9, 22, 24, 25, 29, 30, 5, 3, 19)
'For ctlID = 1 to 57
' Select Case Controls
' Case ("Title" & ctlID)_Click
' DoCmd.OpenReport "GEN-ALL", acViewPreview, , "[Make] = " & [MakeVar], , Controls("Title" & ctlID).Text
' End Case Select
'Next CurrentControl
All the research I've done seems to indicate the Brute Force method (57 separate macros). Whilst that Does work ... it's a real Cow to type out.
Any help much appreciated, in fact, Many Thanks for even reading my post
Bruce54