1

I need help in creating a form that can query a database and generate reports in access. For eg: if I want to know what type of products that were sold in year 2010, I will select the type of product from a "product combo box" and then will select the 2010 month from "month combo box". After clicking OK or RUN it would give me a list of all products for that month. It is possible to create such query form in access with the help of VBA? I would really appreciate your advice.

Thanks a lot.

1 Answer 1

2
Dim ssql as String
ssql = "SELECT * FROM your_table WHERE [Month]=" & Me.cboMonth & " AND [Prod]=" & Me.cboProd

DoCmd.OpenReport "Sales Report",,,,,,,ssql

http://msdn.microsoft.com/en-us/library/bb238032%28v=office.12%29.aspx

you may need if statement for checking how many parameter user select (checkboxs).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.