Crosstab Query Declare parameters (1 Viewer)

Snowflake68

Registered User.
Local time
Today, 08:54
Joined
May 28, 2014
Messages
452
I have a query that has parameters which are defined by what is selected in several combo boxes on a form. All this is working fine however I want to create a crosstab query that uses the same query to filter the results in the crosstab.

I have declared the data type for each of the parameters (right click in design view of the crosstab query and select parameters). But each of the parameters has a wildcard statement like the one below. But I get an error saying Invalid bracketing of name 'Like [Forms]![frmSkills]![cboSelectInitials] & "*"

Code:
Like [Forms]![frmSkills]![cboSelectInitials] & "*"

but if I remove the like and the then it works fine.

The code below works OK but I need to include the wildcard bit. Does anyone know what the correct syntax is please?

Code:
[Forms]![frmSkills]![cboSelectInitials]
 

Minty

AWF VIP
Local time
Today, 08:54
Joined
Jul 26, 2013
Messages
10,371
If your combo is only displaying valid search criteria, why do you need the Like ?
 

Snowflake68

Registered User.
Local time
Today, 08:54
Joined
May 28, 2014
Messages
452
If your combo is only displaying valid search criteria, why do you need the Like ?

There are instances where the user wants to see anything that matches the first part of the text. So for instance if they select DAB then it will return DAB, DAB1, DAB2 etc.

Annoying but it is required.
 

Minty

AWF VIP
Local time
Today, 08:54
Joined
Jul 26, 2013
Messages
10,371
I think you can declare the parameters as [Forms]![frmSkills]![cboSelectInitials]

Then in the criteria use Like [Forms]![frmSkills]![cboSelectInitials] & "*" , I don't have a suitable cross tab handy to test.
 

Snowflake68

Registered User.
Local time
Today, 08:54
Joined
May 28, 2014
Messages
452
I think you can declare the parameters as [Forms]![frmSkills]![cboSelectInitials]

Then in the criteria use Like [Forms]![frmSkills]![cboSelectInitials] & "*" , I don't have a suitable cross tab handy to test.

This is what I already have but didnt realise that it was already working exactly as I wanted it to. :eek: so thanks for pointing this out. I neglected to have the correct data in order to test it properly but now have.

Many thanks
 

Minty

AWF VIP
Local time
Today, 08:54
Joined
Jul 26, 2013
Messages
10,371
Glad to help.

Wood Trees etc... All been there.
 

Users who are viewing this thread

Top Bottom