I think u have got the wrong idea.
What I mean is :
For example I key in "1/12/02" for [Enter begin date] and "31/12/02" for [Enter end date], I want "1/12/02" and "31/12/02" to be appear on the report.
I don't wanna capture the result. I just wanna capture the value entered by user.
I think u have got the wrong idea.
What I mean is :
For example I key in "1/12/02" for [Enter begin date] and "31/12/02" for [Enter end date], I want "1/12/02" and "31/12/02" to be appear on the report.
I don't wanna capture the result. I just wanna capture the value entered by user.
If I understand you correctly, Access is generating the input boxes on the fly as a result of you defining a parameter query. What you want to do is capture the input into the boxes Access generates and then put those values on a report.
If this is the case, I don't know of any way to get those values because Access is generating the variables to which the values are passed. If you define your own input forms, you can capture those values and put them in your report because you will have specified the variable names. - - - -
=)
Anyway Thanks Bry.
You are indeed a good helper.
Btw, do u know how to set the field of a msgbox into hidden field?
Example:
Private Sub Command33_Click()
Dim stLinkCriteria As String
If InputBox("Enter Password to enter", "Enter Your Password" = "123" Then
stDocName = "Main"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Maximize
End If
Exit_Command33_Click:
Exit Sub
Err_Command33_Click:
MsgBox Err.Description
Resume Exit_Command33_Click
End Sub
As for the above, you only can enter is u enter 123. But when i was typing out the password, it actually show out "123". How can I do to make it show a hidden field "***" rather than "123"
If your report is based on a query (as it really should be), simply add two parameter fields to the query, one for start date and one for end date. Bind the text boxes in your report to these two fields. When the report is run, it goes to the query and prompts for the dates, hence the parameter query.
Has always worked for me!
Good hunting. %-) Robert L. Johnson III, A+, Network+
robert.l.johnson.iii@citi.com
Access Database Designer/Administrator
Robert, what value to you bind the report's text boxes to? I understand to the parameter fields, but can you specify the syntax and the values? I've always written separate input forms. - - - -
If your query that your form is based on has a date field, you can use that field.....
Remove and existing date field you have on the query
Create one field:
In the Field Line of the query, place
StartDate: [datefield]
In the Criteria Line, place
>=[Enter Start Date]
Create another field:
In the Field Line of the query, place
EndDate: [datefield]
In the Criteria Line, place
<=[Enter End Date]
On your report, create two text boxes.
In the Control Source property of one, place:
=[StartDate]
In the other COntrol Source, place:
=[EndDate]
Make sure you have labels if you want the user to see these criteria or hide the boxes if you don't need them to see them.
With this, when the user opens the report, the report looks to the query to fill in the data. Since the query is asking a parameter value for the two fields, the report has to ask for it to tell the query what to print. The first box says display any date that is after the StartDate you enter and the second box says show any date before the EndDate. If the user doesn't need to see these dates, let me know. There is a shorter way. But I gathered from your query that you needed to display the dates on the report. Good Luck. %-)
There is no I in team.
Robert L. Johnson III, A+, Network+
robert.l.johnson.iii@citi.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.