Query - Textbox Value + Tick Box Value

csharrock69

Registered User.
Local time
Today, 02:49
Joined
Dec 16, 2010
Messages
11
A kind request to all you access gurus out there:

I’ve been trying to construct a query that will display the list of objects used in a particular cycle. For example, the search results will return a list of objects only used in cycle 1 when a “1” is entered into the textbox. Ok, that bit was straight forward and working however I’m stuck at this next step.

There are some objects used in a cycle in a particular position (we call a “Z” position) so these object records will have a cycle used value of “1Z”, or “5Z” or “11Z” etc, depending on which cycle it was used in.

The idea I have in my head at the moment is to return results for the value entered into the text box (the number- eg cycle “3”) and also return results for that same number PLUS the value of a tick box. The tick box will be ticked on object records that are used in a z position. As an example; for an object used in cycle 5, with the Z Position tick box ticked, the query search results would return all objects used in cycle 5 AND all objects used in cycle 5 in a Z position. Is this a sensible approach to the problem? If so, what code do I need to actually implement this?

Currently, if a “1” is entered into the search box, objects used in cycle 1, 10, 11, 1Z and 11Z will be returned in the results. This is undesirable as I only want 1 and 1Z values to be returned! I’ve removed the * from the criteria only to find that when a “1” is entered into the search box, only cycle 1 values are returned and not 1Z values – undesirable yet again. Doh!

I’m new to access so please don’t go too technical on me!!

Many Thanks

Chris.
 
Going by your last paragraph it looks like you basically have it.

Presumably you current criteria is something like [Forms]![FormName]![ControlName]?

This could be altered to [Forms]![FormName]![ControlName] or [Forms]![FormName]![ControlName] & "Z", which would mean it only returns the number selected and the number selected followed by Z.
 
Going by your last paragraph it looks like you basically have it.

Presumably you current criteria is something like [Forms]![FormName]![ControlName]?

This could be altered to [Forms]![FormName]![ControlName] or [Forms]![FormName]![ControlName] & "Z", which would mean it only returns the number selected and the number selected followed by Z.


Thank you! It does exactly what I want it to do now.

Kind Regards

Chris.
 

Users who are viewing this thread

Back
Top Bottom