David Mack
Registered User.
- Local time
- Today, 05:45
- Joined
- Jan 4, 2000
- Messages
- 53
I’ve been building an application to do word searches in those puzzle grids for my youngest son. You know, the kind where words are placed backwards, diagonally, forward, vertical, horizontal? Well , the app works fine and locates everything. My dream was to have the app find the word and then highlight it on a form.
Background. The data is entered in a 27x27 (any bigger is beyond the Access control limit) grid in an Excel (easy data entry). The worksheet is linked into an A2000 db. I have a search form which starts up my search module. I have also built a form on the fly which makes the 729 little label controls and makes the caption the value in the linked table. The code works with an array, and the location of the first letter of the word is passed back with an x,y coordinate. I want the respective label control on the form to change color. When the form on the fly is built, the name of every label control is given a Name of the assigned x,y coordinate separated by a dash. Left upper corner would be 0-0 and the lower right corner would be 28-28.
The point is I need to reduce code by passing the x-y coordinate into the control name but I am having trouble. The string looks fine and I thought I could use the Eval command. Could someone help?
--This works from my module
Forms![frmWordSearch]![2-0].BackColor = 123123
--Tried many variations of this and other concatenations to no avail
Eval ("Forms![frmWordSearch]![" & InStr(1, strForward, strSearchWord, vbBinaryCompare) & "-" & y & "].BackColor = 123123")
Thank you,
Dave
Background. The data is entered in a 27x27 (any bigger is beyond the Access control limit) grid in an Excel (easy data entry). The worksheet is linked into an A2000 db. I have a search form which starts up my search module. I have also built a form on the fly which makes the 729 little label controls and makes the caption the value in the linked table. The code works with an array, and the location of the first letter of the word is passed back with an x,y coordinate. I want the respective label control on the form to change color. When the form on the fly is built, the name of every label control is given a Name of the assigned x,y coordinate separated by a dash. Left upper corner would be 0-0 and the lower right corner would be 28-28.
The point is I need to reduce code by passing the x-y coordinate into the control name but I am having trouble. The string looks fine and I thought I could use the Eval command. Could someone help?
--This works from my module
Forms![frmWordSearch]![2-0].BackColor = 123123
--Tried many variations of this and other concatenations to no avail
Eval ("Forms![frmWordSearch]![" & InStr(1, strForward, strSearchWord, vbBinaryCompare) & "-" & y & "].BackColor = 123123")
Thank you,
Dave