By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,751 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Not sure what to do.

P: 1
I work for a big corporation and use access to run reports for branches that are located around the world. As I am new in this position I have some problems understanding how to create forms and macros...
Basically here is what I need: The data in our company is stored on DB2 tables. I ran a query to get certain information which uses three DB2 tables. The results of the query went into a table from which I created a report. So anytime someone needs a repot I run my query by chaning two fields all the time: reg date and company ID. Now this Access database needs to be used by users who do not know how to use Access queries and view reports. I need to create a form or macro (not sure which one) to make user enter date range and company ID in order to get an output in the Report like view with all the data from those three DB2 tables that I use in my query. I hope I did not confuse anyone and thanks in advance for your future help on this.
Sep 2 '08 #1
Share this Question
Share on Google+
2 Replies


Expert Mod 2.5K+
P: 2,545
One way to do this is not to use specific clauses in your query as you are doing at present, but instead to design a form for your users to enter (or select) the report dates, using textboxes, comboboxes or listboxes to do so, then to run the report for the dates listed by using what is effectively a WHERE clause in the DoCmd.OpenReport command that opens the report. Example:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "Reportname", acViewPreview, ,  "[Company ID] = '" & Me!YourCompanyIDControlname & "' AND ([Your date field] BETWEEN CDate(me![firstdate]) AND CDate(me![lastdate]))"
Have a look at the sample Northwind database which comes with Access- I am sure it has examples of similar approaches which may be of help.

-Stewart
Sep 2 '08 #2

NeoPa
Expert Mod 15k+
P: 31,344
It sounds to me like you would be well served by checking out some tutorials (Access comes with some I believe) before taking on a task like this.

Some web-based ones :
http://www.functionx.com/access/
http://www.bcschools.net/staff/AccessHelp.htm

I suggest you use a form to control your report. When you have a better understanding of what is available, and what you think you would like to do, come back and ask for help if you need it.
Sep 2 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.