Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

like "*"&[Forms]![MainScreen].[cmbSound]&"*" not wor 1

Status
Not open for further replies.

Triacona

Technical User
Jun 11, 2009
462
0
0
GB
Dear All,
Thanks for a great forum!!![2thumbsup]

I have the following problem and any help would be greatly appreciated.

I have a few fields in my query PolConsultationReport

The fields do not always have data...

I have used the following in the criteria of my Sound field.

Code:
Like "*" & [Forms]![MainScreen].[cmbSound] & "*"

It only pulls a few records, not all of them.
I have tried different table joins within the query.

The tables that are joined are CustomersMainTable to Representations (One to Many, One customer to many representations)

The field Sound in the query comes from the Representations table.

Is there a way to pick up all information even if the field is blank.
Because I have a few combo boxes on the form and want if they are blank to show all records.

Again any help would be greatly appreciated [bigsmile]
Thank you![thumbsup]


Thank you,

Kind regards

Triacona
 

Did you try:
Code:
WHERE Sound Like "*" & [Forms]![MainScreen].[cmbSound] & "*"
OR Sound = ""
or
Code:
WHERE Sound Like "*" & [Forms]![MainScreen].[cmbSound] & "*"
OR Sound IS NULL

Have fun.

---- Andy
 
Dear Duane,

I will try that [smile]!
Thank you![thumbsup]
@Andy if I run into any trouble I will try your SQL[smile]
Thanks [smile]

Thank you,

Kind regards

Triacona
 
Dear Duane,

I have tried
Code:
[Sound] & "" Like "*" & [Forms]![MainScreen].[cmbSound] & "*"
This doesn't seem to work either [banghead], it'll do it for No but not yes, strange!!!

Row Source Type: Value List.
Row source: Yes;No

I have also tried "Yes";"No"

I have no idea why this is not working...[cry]
Please help, I am quite stuck..
Thank you![smile]

Thank you,

Kind regards

Triacona
 
Dear Duane,
Code:
[Sound] & "" Like "*" & [Forms]![MainScreen].[cmbSound] & "*"
Works now!
I had to change a few data types on the table to text, as they were cmbboxes on the table with their own preset values?!

This was setup by someone else than me.

But now since I have changed them to text and only used form cmbboxes, it now works with the above code!
YAY!
Thank you again Duane![smile]
Have a star![2thumbsup]



Thank you,

Kind regards

Triacona
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top