Query based on the text you click?

rtfanson

Registered User.
Local time
Today, 15:21
Joined
Jun 11, 2007
Messages
11
Hello

I'm trying to set-up a database that will allow the user to navigate around by clicking but having a bit of trouble.

I was wondering if there is anyway to capture the text that you click (if you make it a hyperlink or something) so that you can use it as the parameter in a query or something?

Any help would be absolutely fantastic.
Thanks.

Richard
 
If you right click the text field and chose properties there is an 'On Click' option. Here you can tell access what to do or where to go when the user clicks the text.

Hope it helps
 
It's probably more conventional to use buttons for navigation. For selecting query criteria, use combo boxes filled with options, then have your query use the selected option as a criterion.
 
you can do pretty well anything you like

associated with each control (text box) are lots of events - generally we deal with change events such as before update and after update

however there are events such as on enter, and on exit

in your scenario therefore in an onexit event you could capture the current value of a control and store it in a variable. you can then apply this variable back into any other control in any way you can manage, eg via a button, or another control event

you can design your own have the shortcut-right click menus to offer choices to the user

i think the main thing is that users are used to a standard windows type interface, and may be uncomfortable if you design something that works in a different way.

For instance most forms have a close button and users expect a close button - on rare occasions, I do remove the close button, and provide my own close commands, but this is very rare, and only if i need to do some processing that is otherwise very hard to achieve directly through the close button.
 
So how do I capture the current value of a control and store it in a variable?
 
pick an event

the current event will fire every time you move ot a new record, including the first

then say

myvariable = myfield

where myvariable is the variable you are trying to set and
myfield is the name of the control/field you are trying to use - its just that if you then change the field, it wont save the change in myvariable -

hence - you need to decide which event you want, and when you want to save it - we dont know what you want to do with the variable next
 
make sure to be aware of the scope of variables and declare them in the correct place depending on where you will reference them.
 
I personally prefer to use a module.

With CodeContextObject

[MyField] = '" & .[MyText] & "'"

This criteria is re-useable it is occurs again.

Simon
 
In a query you can directly reference the contents of a control - combobox for example - use the build function in the criteria field.
 

Users who are viewing this thread

Back
Top Bottom