Query has gone haywire. It used to work (pointing query to combo boX)

homer2002

Registered User.
Local time
Today, 11:43
Joined
Aug 27, 2002
Messages
152
I created a query that used to work, but now it doesn't.
In the query there is a critea section to look for the value of a combo box
this is what it looked like


=[forms]![report-Team_Performance].[Combo_Team]

It used to show all the data for anything matching the combo box

somehow (and I have no idea why) it has stopped working, however if i enter in

<>[forms]![report-Team_Performance].[Combo_Team]


....the query works the way you would expect it to... it shows all the data EXCEPT the selected field in the combo box.

how come NOT EQUALS works but my original EQUALS TO doesn't???
 
Yeah I tried with and without.

This is a stange one to me. You see it always used to work.

I don't suppose it has anything to do with the fact that I split the database? I don't think it should make a difference but you never know.

The thing that gets me is the query works in reverse (using <>) but not normally, so the critea MUST be pointing to the correct place.

Roll on the demise of Microsoft it'll be a happier (and cheaper) world of coding for us all!
 
Ok i've just found somthing else out.

When I create a combo box for the query to point to.


It works if I don't hide the Key field (primary key of type REPLICATION ID)

it doesn't work if i DO hide it. (although surely it's just hidden)


any ideas???
 
I've had exactly the same problem, in a previous database it worked perfectly, but now whenever I go back to that database it doesn't work either. It's like Access has just switched off being able to do that or something. I'm using Access 97, which version are you using?
 
Funnily Enough, i'm using Access 97 too.

*******
i've just found a sneaky way round this problem

.
I created a combo box and DIDN'T hide the key column

I made the 1st "Column Width" of the combo box to as close to 0.0 as I could (so it wasn't hidden, just really small)

then I made a label with no caption in it.

Make the Combo box as small as you can get it, so it just looks like a button with a drop down arrow.

put the label next to it, so you've got something that kinda looks like a normal combo box but is a label and a really thin combo box next to it.

in the OnChange Event of the combo box put the code

Label_LabelYouCreated.caption = combo_YourComboBox.column(1)

(or which ever column you want to be displayed - 0 is the first column, 1 is the 2nd etc.)


and hey presto a fake combo box (exepct you can't do any autofills or type the first letter to skip down the combo box)


*******
Try to build a dummy proof system...... fail...... and call yourself Microsoft!
 
Last edited:
Thanks, it works fine, except it doesn't let you see what's actually in the column you searched for in the combo box, it just brings up what's in column 0. I wonder why it all of a sudden stopped working? I also wonder if it only effects Access97?
 
I've found another way, if the table the combo box gets its data from only has one field (the data field, no key field), then it works perfectly.
 

Users who are viewing this thread

Back
Top Bottom