Like Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query which picks up information chosen from a drop down list on a
form.

Form name - cost centre
field - ccentre

my query being that I am trying to include this field as part of a criteria.

i.e. Like [forms!cost centre!ccentre]&"-****-***"
(where the ccentre holds the first four digits to the code)

but this is not working. However, if I substitute the forms reference and
just enter one of the numbers in the drop down list, the query works.

I know you clever people have helped me in the past, and for that I'm very
gratefull, but would like to call on you to help me again.

Kind Regards
 
Thanks for that John, but it didn't work.

It showed me all records instead of limiting to what's chosen on the form.

JohnFol said:
Try this

Like forms![cost centre]![ccentre]&"*"





Lynne said:
I have a query which picks up information chosen from a drop down list on a
form.

Form name - cost centre
field - ccentre

my query being that I am trying to include this field as part of a
criteria.

i.e. Like [forms!cost centre!ccentre]&"-****-***"
(where the ccentre holds the first four digits to the code)

but this is not working. However, if I substitute the forms reference and
just enter one of the numbers in the drop down list, the query works.

I know you clever people have helped me in the past, and for that I'm very
gratefull, but would like to call on you to help me again.

Kind Regards
 
Lynne said:
I have a query which picks up information chosen from a drop down list on a
form.

Form name - cost centre
field - ccentre

my query being that I am trying to include this field as part of a criteria.

i.e. Like [forms!cost centre!ccentre]&"-****-***"
(where the ccentre holds the first four digits to the code)

but this is not working. However, if I substitute the forms reference and
just enter one of the numbers in the drop down list, the query works.

I know you clever people have helped me in the past, and for that I'm very
gratefull, but would like to call on you to help me again.

Kind Regards


Since you used a space in the form name, you have to enclose it with brackets:

Like [forms]![cost centre]![ccentre] & "-****-***"



If you need/want that specific format, ie "dash 4 chars dash 3 chars", try this:


Like [forms]![cost centre]![ccentre] & "-????-???"

HTH
 
Sorry John

Just tried it again now - works a treat. Typo with ccentre and ccenter! -
doh......

Thanks very much for your help

JohnFol said:
Try this

Like forms![cost centre]![ccentre]&"*"





Lynne said:
I have a query which picks up information chosen from a drop down list on a
form.

Form name - cost centre
field - ccentre

my query being that I am trying to include this field as part of a
criteria.

i.e. Like [forms!cost centre!ccentre]&"-****-***"
(where the ccentre holds the first four digits to the code)

but this is not working. However, if I substitute the forms reference and
just enter one of the numbers in the drop down list, the query works.

I know you clever people have helped me in the past, and for that I'm very
gratefull, but would like to call on you to help me again.

Kind Regards
 
Back
Top