Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to capture parameter value?

Status
Not open for further replies.

JasonLiew

Programmer
Oct 15, 2001
37
SG
Hi all,

I have 2 parameter value to be enter at the same time.
Eg: [Enter begin date], [Enter end date]

My problem is how to capture both values and to show it on report?
Any helpers?

Jason.[upsidedown]
 
Take a look at this:

thread703-234319

As to showing the values (dates) on the report, you can use text boxes to display them on the report. - - - -

Bry
 
Hi Bry,

I think u have got the wrong idea.[bigsmile]
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.[bigsmile]

Cheers!
Jason.
 
Hi Bry,

I think u have got the wrong idea.[smile]
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.[smile]

Cheers!
Jason.
 
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. - - - -

Bry
 
=)
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"

Take note: Its in Msgbox, not textfield.

Jason.
 
Sorry . .the only way I know to do it is to use a text field! - - - -

Bry
 
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. - - - -

Bry
 
In the text box control source just repeat your parameter [Enter begin date] :)
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top