using a shortform to input details

T

toby

hi all,

i'm now using the following method to input the details of each customer
everytime when i generating the report.

box1: =[enter customer name]
box2: =[enter customer address]

each time when i open the report the 2 dialog of the above stuff will popup
and ask me to enter the details.
i 'd like to know if there any method to set up the details such as name,
address, .... etc. so that i can enter the code , let's say, "001" or "abc",
then the corresponding details of "abc", "001" would be shown in the above 2
boxes automatically.?!!?

Thanks in advanced.

Regards,
Toby
 
G

Guest

There are two ways of doing this in a better way, providing you have a form
where your customer is listed. That way you can open the form to the desired
customer.
You could modify the query used for the source in your report and set the
criteria for the applicable fields equal to the field on the form that
contains the data elements. or possibly create a customer ID field in the
customer table and set the criteria to that field.
An other way is with some code:

I would use code with the command button like:
Dim strWhere as String
strWhere = "ID=" & Me.txtID
DoCmd.OpenReport "rptYourReport", acPreview, , strWhere
This code assumes
-your field name is ID
-you have a text box bound to the ID field named txtID
-your field in numeric
-your report name is "rptYourReport"
-you want the report to open in preview mode
Hope this helps.
Fons
 
G

Guest

There are two ways of doing this in a better way, providing you have a form
where your customer is listed. That way you can open the form to the desired
customer.
You could modify the query used for the source in your report and set the
criteria for the applicable fields equal to the field on the form that
contains the data elements. or possibly create a customer ID field in the
customer table and set the criteria to that field.
An other way is with some code:

I would use code with the command button like:
Dim strWhere as String
strWhere = "ID=" & Me.txtID
DoCmd.OpenReport "rptYourReport", acPreview, , strWhere
This code assumes
-your field name is ID
-you have a text box bound to the ID field named txtID
-your field in numeric
-your report name is "rptYourReport"
-you want the report to open in preview mode
Hope this helps.
Fons
 
T

toby

Dear Fons Ponsioen,

i dont know how to make it. could u explain a bit more ?!?!
as i'm using report with a query source already. so i would like to hv a
dialog box asking me for customer ID each time when i open the report for
preview and printing.

Thaak you in advanced.

rgds,
toby


Fons Ponsioen said:
There are two ways of doing this in a better way, providing you have a
form
where your customer is listed. That way you can open the form to the
desired
customer.
You could modify the query used for the source in your report and set the
criteria for the applicable fields equal to the field on the form that
contains the data elements. or possibly create a customer ID field in the
customer table and set the criteria to that field.
An other way is with some code:

I would use code with the command button like:
Dim strWhere as String
strWhere = "ID=" & Me.txtID
DoCmd.OpenReport "rptYourReport", acPreview, , strWhere
This code assumes
-your field name is ID
-you have a text box bound to the ID field named txtID
-your field in numeric
-your report name is "rptYourReport"
-you want the report to open in preview mode
Hope this helps.
Fons


toby said:
hi all,

i'm now using the following method to input the details of each customer
everytime when i generating the report.

box1: =[enter customer name]
box2: =[enter customer address]

each time when i open the report the 2 dialog of the above stuff will
popup
and ask me to enter the details.
i 'd like to know if there any method to set up the details such as name,
address, .... etc. so that i can enter the code , let's say, "001" or
"abc",
then the corresponding details of "abc", "001" would be shown in the
above 2
boxes automatically.?!!?

Thanks in advanced.

Regards,
Toby
 
G

Guest

Hi Toby.
I'll describe the simpler way.
Let us assume that you have a form on which you normally review your
customers, and that this for is named "customers", on this form you have two
textboxes named "CustomerName" and "CustomerAddress".
I assume you currently have the query with the criteria,
=[enter customer name]
=[enter customer address]
instead you would type in these criteria:
Forms![Customers]![CustomerName]
and
Forms![Customers]![CustomerAddress]
Now you could print the report(s) from a button on the customer form. The
only thing is that the customer form must be open when you run the report(s).
Hope this helps.
Fons



Fons Ponsioen said:
There are two ways of doing this in a better way, providing you have a form
where your customer is listed. That way you can open the form to the desired
customer.
You could modify the query used for the source in your report and set the
criteria for the applicable fields equal to the field on the form that
contains the data elements. or possibly create a customer ID field in the
customer table and set the criteria to that field.
An other way is with some code:

I would use code with the command button like:
Dim strWhere as String
strWhere = "ID=" & Me.txtID
DoCmd.OpenReport "rptYourReport", acPreview, , strWhere
This code assumes
-your field name is ID
-you have a text box bound to the ID field named txtID
-your field in numeric
-your report name is "rptYourReport"
-you want the report to open in preview mode
Hope this helps.
Fons


toby said:
hi all,

i'm now using the following method to input the details of each customer
everytime when i generating the report.

box1: =[enter customer name]
box2: =[enter customer address]

each time when i open the report the 2 dialog of the above stuff will popup
and ask me to enter the details.
i 'd like to know if there any method to set up the details such as name,
address, .... etc. so that i can enter the code , let's say, "001" or "abc",
then the corresponding details of "abc", "001" would be shown in the above 2
boxes automatically.?!!?

Thanks in advanced.

Regards,
Toby
 
G

Guest

Hi Toby.
I'll describe the simpler way.
Let us assume that you have a form on which you normally review your
customers, and that this for is named "customers", on this form you have two
textboxes named "CustomerName" and "CustomerAddress".
I assume you currently have the query with the criteria,
=[enter customer name]
=[enter customer address]
instead you would type in these criteria:
Forms![Customers]![CustomerName]
and
Forms![Customers]![CustomerAddress]
Now you could print the report(s) from a button on the customer form. The
only thing is that the customer form must be open when you run the report(s).
Hope this helps.
Fons



toby said:
Dear Fons Ponsioen,

i dont know how to make it. could u explain a bit more ?!?!
as i'm using report with a query source already. so i would like to hv a
dialog box asking me for customer ID each time when i open the report for
preview and printing.

Thaak you in advanced.

rgds,
toby


Fons Ponsioen said:
There are two ways of doing this in a better way, providing you have a
form
where your customer is listed. That way you can open the form to the
desired
customer.
You could modify the query used for the source in your report and set the
criteria for the applicable fields equal to the field on the form that
contains the data elements. or possibly create a customer ID field in the
customer table and set the criteria to that field.
An other way is with some code:

I would use code with the command button like:
Dim strWhere as String
strWhere = "ID=" & Me.txtID
DoCmd.OpenReport "rptYourReport", acPreview, , strWhere
This code assumes
-your field name is ID
-you have a text box bound to the ID field named txtID
-your field in numeric
-your report name is "rptYourReport"
-you want the report to open in preview mode
Hope this helps.
Fons


toby said:
hi all,

i'm now using the following method to input the details of each customer
everytime when i generating the report.

box1: =[enter customer name]
box2: =[enter customer address]

each time when i open the report the 2 dialog of the above stuff will
popup
and ask me to enter the details.
i 'd like to know if there any method to set up the details such as name,
address, .... etc. so that i can enter the code , let's say, "001" or
"abc",
then the corresponding details of "abc", "001" would be shown in the
above 2
boxes automatically.?!!?

Thanks in advanced.

Regards,
Toby
 
T

toby

i've make it. i think.~!
by using subreport of that query.

thanks Fons anyway.

toby

Fons Ponsioen said:
Hi Toby.
I'll describe the simpler way.
Let us assume that you have a form on which you normally review your
customers, and that this for is named "customers", on this form you have
two
textboxes named "CustomerName" and "CustomerAddress".
I assume you currently have the query with the criteria,
=[enter customer name]
=[enter customer address]
instead you would type in these criteria:
Forms![Customers]![CustomerName]
and
Forms![Customers]![CustomerAddress]
Now you could print the report(s) from a button on the customer form. The
only thing is that the customer form must be open when you run the
report(s).
Hope this helps.
Fons



toby said:
Dear Fons Ponsioen,

i dont know how to make it. could u explain a bit more ?!?!
as i'm using report with a query source already. so i would like to hv a
dialog box asking me for customer ID each time when i open the report for
preview and printing.

Thaak you in advanced.

rgds,
toby


Fons Ponsioen said:
There are two ways of doing this in a better way, providing you have a
form
where your customer is listed. That way you can open the form to the
desired
customer.
You could modify the query used for the source in your report and set
the
criteria for the applicable fields equal to the field on the form that
contains the data elements. or possibly create a customer ID field in
the
customer table and set the criteria to that field.
An other way is with some code:

I would use code with the command button like:
Dim strWhere as String
strWhere = "ID=" & Me.txtID
DoCmd.OpenReport "rptYourReport", acPreview, , strWhere
This code assumes
-your field name is ID
-you have a text box bound to the ID field named txtID
-your field in numeric
-your report name is "rptYourReport"
-you want the report to open in preview mode
Hope this helps.
Fons


:

hi all,

i'm now using the following method to input the details of each
customer
everytime when i generating the report.

box1: =[enter customer name]
box2: =[enter customer address]

each time when i open the report the 2 dialog of the above stuff will
popup
and ask me to enter the details.
i 'd like to know if there any method to set up the details such as
name,
address, .... etc. so that i can enter the code , let's say, "001" or
"abc",
then the corresponding details of "abc", "001" would be shown in the
above 2
boxes automatically.?!!?

Thanks in advanced.

Regards,
Toby
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top