SpareHead3
New member
- Local time
- Yesterday, 23:51
- Joined
- May 22, 2025
- Messages
- 13
Hi folks. I'm at a bit of a loss as to the reason why this is happening. I can circumvent it but the symptom is so oddly specific I can't believe it wasn't incorporated into the Access or Visual Basic with a specific purpose in mind.
This is also a long one so I'm splitting up my explanation into multiple posts.
Background
I use Access to document/catalog my Media collections (DVD/BR/4K and Mass Market Paperback). my largest collection is my Anime collection, with over 2100 titles spanning 2549 DVDs and 1733 Blu Ray discs.
When I started, I had a few hundred titles. To navigate the list, I used a ComboBox ([Combo51]) and a Logitech MX series mouse (which has a free-spinning scroll-wheel ability). One good spin and I could scroll from record 1 to record 800-1000 in less than 2 seconds. But now with over 2000 titles, scrolling from the first record to the last letters of the alphabet is a bit... tedious.
So I wanted to create a tabbed selection method similar to the old metal tabbed index address books. I wanted dynamic tabs- Tabs that would change based on the selected record. The easiest way to do this was to use transparent buttons on top of a dynamic ImageBox. An [ImageTab] field was added to the database for the appropriate filename to be associated with each record, and the ImageBox's Control Source was set to "=[CurrentProject].[Path] & "\Data\Index\" & [IndexTab]'.
A note about organization- I don't use strict alphabetization to organize my collection- Ex. The titles Brave Witches and World Witches Take Off! are sequel spinoffs within the Strike Witches franchise, but I keep them together in the list. When I first created the database, I used a field I've named [AIN] (Arbitrary Index Number); The number is arbitrary because it will change as titles are added and the displaced records are incremented by one to make room. Ex. Yesterday, Strike Witches - The Complete First Season had an [AIN] number of 1773. I added Hero Tales Part 1 and Part 2 to the list after the [Disc Title] "Hellsing Ultimate - Volumes IX-X" ([AIN] = 956) and so all titles after them had their [AIN] values increment by 2, which means the [AIN] number for "Strike Witches - The Complete First Season" is now 1775.
I just call it "Loose Alphabeticalization".
Because of this, there will be some titles where the first letter of the title won't coincide with where it sits "alphabetically"- The aforementioned Strike Witches titles begin with the letter S, so they belong "alphabetically" with other titles that begin with the letter S... but as Brave Witches and World Witches Take Off! are part of the Strike Witches series as a whole, I want them to be in the list where the Strike Witches titles are. To make sure the appropriate [ImageTab] is associated with those records, I created a new field similar to the [AIN] field call [AAC] or Arbitrary Alphabetical Character. Using this, I could just enter the appropriate character (# for punctuation and numbers, A-Z for everything else) and the [IndexTab] field could automatically be populated with a simple line [IndexTab] = "Tabs_" & [AAC] & ".png".
So, selecting a record for display in the form using the ComboBox is a fairly simple code:
To create the tabbed selection interface, there needs to be 27 individual transparent buttons each coded to a particular character/letter, and 27 images of tabs evenly spaced for the buttons to sit on top of- The code for the buttons is similar to the Combo51 code:
... and to update the [IndexTab] field, I make it so 1) the [AAC] field will only accept either the "#" character or the letters A-Z or a-z, then converts lowercase letters to uppercase... then generate the filename to populate the [ImageTab] field:
One of the features I thought was really cool when navigating the database via the ComboBox is that If I don't reset (Requery?) it, I can re-open/.Dropdown the menu and continue scrolling up or down from the record I previously selected... Very convenient if I'm 1500 records down the list and I only need to scroll up or down 50 or so records.
Well, I want that same convenience in the ComboBox when I click a tab. The whole idea of creating the tab interface is to be able to quickly jump directly to a specific letter, then continue scrolling from that point to the exact record I'm looking for or the exact location I want to insert a new record. I figure that should be easy enough to implement since, as I said, I don't clear the [Combo51] variable, so I should be able to set the variable within the button's code:
And, after copying/pasting the the above code for each button... this actually works. I click the K tab/button, and the first record where the [AAC] field = 'K' gets displayed; [IndexTab] = "tabs_K.png", and the appropriate image the letter "K" highlighted appropriately appears along the left side of the form:
When I click the ComboBox icon, it opens to show the same record displayed in the form (allowing me to continue my search by scrolling up or down to find the exact record I need):
I do have to manually added letters to the [AAC] field and the appropriate filenames to the [ImageTab] field for all existing records, but that's about 20 minutes of copy/pasting data directly into the DVD and Blu Rays table; New records get their fields populated as expected.
So I'm done, right? We're done? Good. I'm done. Close the program and wait for a new title to come from Amazon or eBay.
(Or so I thought).
This is also a long one so I'm splitting up my explanation into multiple posts.
Background
I use Access to document/catalog my Media collections (DVD/BR/4K and Mass Market Paperback). my largest collection is my Anime collection, with over 2100 titles spanning 2549 DVDs and 1733 Blu Ray discs.
When I started, I had a few hundred titles. To navigate the list, I used a ComboBox ([Combo51]) and a Logitech MX series mouse (which has a free-spinning scroll-wheel ability). One good spin and I could scroll from record 1 to record 800-1000 in less than 2 seconds. But now with over 2000 titles, scrolling from the first record to the last letters of the alphabet is a bit... tedious.
So I wanted to create a tabbed selection method similar to the old metal tabbed index address books. I wanted dynamic tabs- Tabs that would change based on the selected record. The easiest way to do this was to use transparent buttons on top of a dynamic ImageBox. An [ImageTab] field was added to the database for the appropriate filename to be associated with each record, and the ImageBox's Control Source was set to "=[CurrentProject].[Path] & "\Data\Index\" & [IndexTab]'.
A note about organization- I don't use strict alphabetization to organize my collection- Ex. The titles Brave Witches and World Witches Take Off! are sequel spinoffs within the Strike Witches franchise, but I keep them together in the list. When I first created the database, I used a field I've named [AIN] (Arbitrary Index Number); The number is arbitrary because it will change as titles are added and the displaced records are incremented by one to make room. Ex. Yesterday, Strike Witches - The Complete First Season had an [AIN] number of 1773. I added Hero Tales Part 1 and Part 2 to the list after the [Disc Title] "Hellsing Ultimate - Volumes IX-X" ([AIN] = 956) and so all titles after them had their [AIN] values increment by 2, which means the [AIN] number for "Strike Witches - The Complete First Season" is now 1775.
I just call it "Loose Alphabeticalization".
Because of this, there will be some titles where the first letter of the title won't coincide with where it sits "alphabetically"- The aforementioned Strike Witches titles begin with the letter S, so they belong "alphabetically" with other titles that begin with the letter S... but as Brave Witches and World Witches Take Off! are part of the Strike Witches series as a whole, I want them to be in the list where the Strike Witches titles are. To make sure the appropriate [ImageTab] is associated with those records, I created a new field similar to the [AIN] field call [AAC] or Arbitrary Alphabetical Character. Using this, I could just enter the appropriate character (# for punctuation and numbers, A-Z for everything else) and the [IndexTab] field could automatically be populated with a simple line [IndexTab] = "Tabs_" & [AAC] & ".png".
So, selecting a record for display in the form using the ComboBox is a fairly simple code:
Code:
Private Sub Combo51_AfterUpdate()
Me.RecordsetClone.FindFirst "[AIN] = " & Me![Combo51]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
To create the tabbed selection interface, there needs to be 27 individual transparent buttons each coded to a particular character/letter, and 27 images of tabs evenly spaced for the buttons to sit on top of- The code for the buttons is similar to the Combo51 code:
Code:
Private Sub AlphaTab1_Click()
Me.RecordsetClone.FindFirst "[AAC] = '#'"
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
... and to update the [IndexTab] field, I make it so 1) the [AAC] field will only accept either the "#" character or the letters A-Z or a-z, then converts lowercase letters to uppercase... then generate the filename to populate the [ImageTab] field:
Code:
Private Sub AC_LostFocus()
If [AAC] = LCase([AAC]) Then
[AAC] = UCase([AAC])
End If
IndexTab = "Tabs_" & [AAC] & ".png"
End Sub
One of the features I thought was really cool when navigating the database via the ComboBox is that If I don't reset (Requery?) it, I can re-open/.Dropdown the menu and continue scrolling up or down from the record I previously selected... Very convenient if I'm 1500 records down the list and I only need to scroll up or down 50 or so records.
Well, I want that same convenience in the ComboBox when I click a tab. The whole idea of creating the tab interface is to be able to quickly jump directly to a specific letter, then continue scrolling from that point to the exact record I'm looking for or the exact location I want to insert a new record. I figure that should be easy enough to implement since, as I said, I don't clear the [Combo51] variable, so I should be able to set the variable within the button's code:
Code:
Private Sub AlphaTab12_Click()
Me.RecordsetClone.FindFirst "[AAC] = 'K'"
Me.Bookmark = Me.RecordsetClone.Bookmark
[Combo51] = [AIN]
End Sub
And, after copying/pasting the the above code for each button... this actually works. I click the K tab/button, and the first record where the [AAC] field = 'K' gets displayed; [IndexTab] = "tabs_K.png", and the appropriate image the letter "K" highlighted appropriately appears along the left side of the form:
When I click the ComboBox icon, it opens to show the same record displayed in the form (allowing me to continue my search by scrolling up or down to find the exact record I need):
I do have to manually added letters to the [AAC] field and the appropriate filenames to the [ImageTab] field for all existing records, but that's about 20 minutes of copy/pasting data directly into the DVD and Blu Rays table; New records get their fields populated as expected.
So I'm done, right? We're done? Good. I'm done. Close the program and wait for a new title to come from Amazon or eBay.
(Or so I thought).