OptionValue

k209310

Registered User.
Local time
Today, 19:12
Joined
Aug 14, 2002
Messages
184
I have an option value frame and two checkboxes in the frame. I need the result of the selection to be referenced in a query.

Eg if option 1 is selected then i need the query to search one field if option 2 is selected then i need another field to be searched.

The problem i have is referncing the result in the query. I have been looking at using something like Forms!frmCountrySelection!Frame22!OptionValue to reference the frame in the query but the problem is the optionvalue is numerical and can not be changed to an alphabetical value.

Does this means that the fields can not be refernced as the query will be looking for a numerical value of the checkbox selection?

If this is the case is there a way around this little problem? or will I have to change the direction that i am approaching this problem?

Is the Forms!frmCountrySelection!Frame22!OptionValue the correct way to reference the frame in the query.
 
The option value applies to the contents of the option group.

Just reference the frame's value instead, as opposed to the OptionValue.
 
Hi there

Am I right in saying that you need to perform a search based on alphabetical values?

If so, I don't know well you cope with code, but one way around it be to declare in a module a public variable:

Public myString as String

Then create a public function that returns the value that you want to search on

Public Function myOption()

myOption = myString

End Function

Then in the Mouse_Down event of you option controls you can assign a string value to myString and then in your query you can reference the function by putting the following in the criteria for the relevant field

myOption()

I don't know if this what you're looking as you don't say if you need to make an exact search or if you need to search using a wild card, but hopefully I've given you an idea.

Post again if you need more help

Rob
 
Thnaks for that both posts were very useful

Cheers

Chris
 

Users who are viewing this thread

Back
Top Bottom