473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Create a form to enter report criteria?

Create a form to enter report criteria? Anyone can help me with this?
I don't want to do it using the Macros method. Is there a way to do it
using VBA?

Thanks for your cooperation.

Louly

May 30 '06 #1
1 1691
It's very do-able. What you need to do is build up a SQL statment in
code and pass open the report with this statemtent as a where criteria.
eg have a form with a control txtName on it
the user types the name criteria (complete with any wildcards) and
clicks the view report button on your form.
this runs the following air code:

function button_click()
'passes the selected name as a where condition to report rptNames
Dim strSQL as string
strSQL = "[tblNames].[Name] like '" & me.txtName & "'"
DoCmd.OpenReport "rptNames", , , strSQL
End function

You can of course add more controls and make the SQL condition
statement as detailed as you like. You will probably need to learn a
bit more about SQL syntax and string manipulation though.

Hope this helps :)

May 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
3
by: Afton | last post by:
I would like to make a form that filters a report by Supervisor and by starting and ending date. I have the supervisors in a combo box, and that works. However, I do not know how to code to let...
3
by: Glenn Zamora | last post by:
I am new to MS Access. I have created a simple entry form to track patient information. I have also created a Patient Report that prints Patient Information with a standard disclaimer statement. I...
8
by: | last post by:
hi, i have a form on which a user can choose specific criteria such as dates etc, in order to filter the report that is called from the form. i do this by using the Where section of the...
6
by: fieldja | last post by:
I have a form called OwnerForm. It contains a combo box called Owner. The combo box looks up names from a table called OwnerName. It contains fields called OwnerID and Owner. I also have a main...
7
by: Randoz | last post by:
I have created a form per MS Access help for search criteria for a reportand it works great. But is there a way to do it for an edit form? I have duplicated the method and can get 95% of the...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
2
by: eimbert | last post by:
I have designed a report named report by Recruiter. I have made a form called frmRecruitmentReports, on this form I have created a pair of combo boxes . 1.Beggining Date (both are unbound)...
5
by: jgarcia187 | last post by:
I have a report that runs based on parameters set in the underlying query. For example, in the "account number" field in the query I've entered in the criteria area. This allows the user to select...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.