Hello all.
I'm trying to build a fancy interface for a database and fear that I may have waded out of my depth.
The idea is that when scrolling the mouse accross the screen, different pieces of information are called in separate subforms.
The X-Y coordinate of the cursor will trigger different things to happen and call different queries.
One method I'm trying to sort is to populate an unbound text box with a specific field of a recordset.
the table is "tbl_XYEquivalent" the field I would like to return is "Location" and the fields I would like to lookup or query are "X" and "Y" (corresponding to the actual X and Y cursor coordinates respectively)
I could do this using IF statements but this crude method will become tiresome when I start to add new data entries. The record set is already 200 entries strong and if I can avoid typing out the if statements for each of the individual coordinates that would be great.
Maybe a loop could be used.
so far, I have constructed VBA to return the X and Y coordinates of the cursor to two text boxes on the form. These update in real time as the mouse is moved around the screen.
I would now like the "Location" text box to update in real time returning the location that corresponds to the XY values.
better still, if the cursor moves within a range (say +or- 5 of the actual value) of a certain location, the location would be returned to the unbound text box.
I hope this make sense and that someone has an idea of how to help.
thanks in advance.
Chris.
I'm trying to build a fancy interface for a database and fear that I may have waded out of my depth.
The idea is that when scrolling the mouse accross the screen, different pieces of information are called in separate subforms.
The X-Y coordinate of the cursor will trigger different things to happen and call different queries.
One method I'm trying to sort is to populate an unbound text box with a specific field of a recordset.
the table is "tbl_XYEquivalent" the field I would like to return is "Location" and the fields I would like to lookup or query are "X" and "Y" (corresponding to the actual X and Y cursor coordinates respectively)
I could do this using IF statements but this crude method will become tiresome when I start to add new data entries. The record set is already 200 entries strong and if I can avoid typing out the if statements for each of the individual coordinates that would be great.
Maybe a loop could be used.
so far, I have constructed VBA to return the X and Y coordinates of the cursor to two text boxes on the form. These update in real time as the mouse is moved around the screen.
I would now like the "Location" text box to update in real time returning the location that corresponds to the XY values.
better still, if the cursor moves within a range (say +or- 5 of the actual value) of a certain location, the location would be returned to the unbound text box.
I hope this make sense and that someone has an idea of how to help.
thanks in advance.
Chris.
Last edited: