my logic is sound, just stupidly complicated, when there was no need.
I have two fields on a subform, I am creating a modal popup multiple select function when either are double clicked, I need the content of the field that is doubleclicked (which is a comma separated string), split out and then use it to compile a query string to populate an unbound listbox.
Two list boxes on the popup modal form will be used to select or remove items and then when the form closes the listboxes are processed and the comma separated string regenerated and placed in the filed originally double clicked.
Using the Law of Parsimony, I concluded that the simplest assumption was to say your suggestion wouldn't work!
I'd checked your original post at home and couldn't test it till this morning, so used Occums Razzor to assess its posibility for use ;-)
upon retrospective analysis, testing and making many more assumptions than allowed, I have found out that actually I was correct in my conclusion as when I use this code...
Code:
MsgBox Screen.ActiveControl.Name
I get this error...
The expression you entered requires the control to be in the active window
I assumed that 'screen' was the same as saying 'me' (ie. current active form), which does seem to be the case, or perhaps because I need the popup form to be modal, that causes the conflict, either way it does look like I cannot use 'screen' for what i'm trying to achieve.
However, it made me railise that all I needed was
Forms!contacts!subVisits.Form.ActiveControl
&
Forms!contacts!subVisits.Form.ActiveControl.Name
I assume
Code:
Forms!contacts!subVisits.Form.ActiveControl
gets the value of the field double clicked, rather than trying to get the name via
Code:
Forms!contacts!subVisits.Form.ActiveControl.Name
and then putting that into a normal field reference which is what this was trying to do
Code:
Forms!contacts!subVisits.Form.[Forms!contacts!subVisits.Form.ActiveControl.Name]
Using the simpler version I can now test which field was double clicked as the SQL query string has to exclude or include certain records from the classifications table as well as get the current value to parse and pre-populate the other listbox for the multiple select modal popup function.
Hope that makes things clearer
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Google Rank Extractor -> Perl beta with FusionCharts