Ignore blank parametres in query

Thats what you were doing originally, you had a few things typed into the combo box, you select one of them, and the code then pulls the records from the table with matching criteria. There is nothing wrong with doing this.

If i add a new record into the table and search for something in it's record like name=test it still shows the james.90.

This is the reason I changed it. Your problem was that you created a new record in your table, but your one company you had in your company combo box did not match your new record, so it wouldn't display...
 
What part of the code do i need to change to that. I am a newb at SQL and VBA. Is it the code for the GO button?
 
no. You will find this information in the property panel for the individual combo boxes.

Open the form in Design view, right click a combo box and click properties. You will see the field 'Row Source Type', it will have the value Table/Query, click that and select Value List.

Then, in the field below that, 'Row Source', type in the values you want the combo box to have, following this syntax
"Company1"; "Company2"; "Buisness3" etc, replacing Company1 etc with whatever you want.

Note: These values do not reflect your table. If you go and add a new company to your table, that will not show up in your company combo box.
 
Another quick question

I added the companies to the combo list and it worked great. When i tried doing it for the date collum i chaged the Row_Source_Type field to Value List like i did for company but i can't enter the information under Row Source it still says Beta_Query. Is there a setting i have to change or something. It's been bugging me for 10 minutes and i can't seem to fix it.

Thanks
 
No i mean it doesn't give me a box to type values in for example in the combo box working correctly i see

http://img178.imageshack.us/img178/9553/71532236nn0.jpg

And if i go into the date box and do the same thing i see
http://img20.imageshack.us/img20/2460/75847666kv7.jpg

You can see i don't get the ... which opens the box to type in. I tried manually typing it in by "value" and i get this

http://img20.imageshack.us/img20/3060/32675243xz6.jpg

You see no value drops down. Anything i am doing wrong?
 
For the date combo box, see where it says 'Bound Column' Change that to 1
 
Check the Column width property. make sure it isnt 0cm;2cm or something like that

it should just be one number, greater than 0
 
Still doesn't work

I'll attach it and maybe you can work out why
 

Attachments

ok, changes made.

Week Ending Combo Box:
1) Column Count set to 1
2) Values entered into 'Row Source' "bob";"frank";"tom"


Project Combo Box
1) Column Count set to 1
2) Bound column set to 1
3) Column width set to 2 (was 0cm;0cm;2.545cm)
4) Values entered into 'Row Source' "One";"Two"
 

Attachments

Sorry to post again one more problem i am having

The company searches fine so does the project the problem i am having with the date.

When i enter a value into the combo box and select it such as

1/11/2007

Even though that exact field exists in the table it is not getting found.

http://img147.imageshack.us/img147/9417/92663327os7.jpg
That is the value in the database field

http://img86.imageshack.us/img86/2051/82755079qi0.jpg
That is the form view of the value being selcted

http://img297.imageshack.us/img297/1125/69815593uh3.jpg
That is the lack of results being returned.

I can't understand why if company and project work fine. Why won't date.

The format for all of them is text in the database design view.
 
Bump

Any ideas anyone. Sorry to post again but I'm getting desperate!
 
your problem is the way that access handles dates. if you enter your date as 12/7/2007 instead of 7/12/2007 it will work.. If you search the forums you will find ways of dealing with that
 
What would be the date format for

6 june 2008

I've tried

6/6/2008

06/06/2008

06/6/2008

6/06/2008

And each time i get no matches

Other dates with your method seem to work though
 
for starters, that date must be in your table for it to work. You will have to code in checks so that you dont get errors.

As for the format, I think it's determined by the date format you select on the forms WeekEnding field. In the version of your db that I have, one of the dates you had in your table was 7/12/2007 when i typed 12/7/2007 into the form everything worked.
 

Users who are viewing this thread

Back
Top Bottom