Form with report button

D

Denver

Hi,

I have my comboWeek and cmdReport in my form.

1. ) I want my comboweek will only display all my queries with file name
that has "wk". How could I make this possible?

2. ) I want also that my cmdReport will display report whatever I have click
from my
comboWeek. Pls, help me with my codes?

Thanks for any help, I appreciate
 
P

PieterLinden via AccessMonster.com

Denver said:
Hi,

I have my comboWeek and cmdReport in my form.

1. ) I want my comboweek will only display all my queries with file name
that has "wk". How could I make this possible?

2. ) I want also that my cmdReport will display report whatever I have click
from my
comboWeek. Pls, help me with my codes?

Thanks for any help, I appreciate

#1)
You need to show the system tables to do this. Go to main DB window, Tools
menu, Choose Options. Then check "Show System tables".

Then your query should be something like this... (Can't tell... not sure I
understand what you're asking).

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name) Not Like "~*" And (MSysObjects.Name) Like "*wk*")
AND ((MSysObjects.Type)=5));

#2)
Do the same as above, but this time show reports...
SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Type)=-32764))
ORDER BY MSysObjects.Name;

set this as the control source for your combobox...

then in your button

DoCmd.OpenReport me.cboReportToOpen
 
Top