Adding Popup Box

S

stephendeloach

I am wanting to add a box that pops up when i click on a report. When i click
on Drilling Invoice (name of report) i want it to have a box that asks "Date
of Invoice" "Rig Name" and when i click enter, the report comes up with all
of the invoices with that date and with that rig name... I already have it
to where i have to type in the beginning date..click enter. then another box
pops up with ending date, enter ending date..click enter. then rig name pops
up... how can i make all of these on the same box?
 
F

fredg

I am wanting to add a box that pops up when i click on a report. When i click
on Drilling Invoice (name of report) i want it to have a box that asks "Date
of Invoice" "Rig Name" and when i click enter, the report comes up with all
of the invoices with that date and with that rig name... I already have it
to where i have to type in the beginning date..click enter. then another box
pops up with ending date, enter ending date..click enter. then rig name pops
up... how can i make all of these on the same box?

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
RigID field and the RigName.
Name the Combo Box 'FindRig'.
Set it's Bound column to 1.
Set it's Column Count property to 2.
Set the Column Width property to 0";1"

Also add an unbound text control.
Set it's format to a valid date format.
Name this control "InvoiceDate".
Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Query that is used as the Report's Record Source [RigID] field
criteria line write:
forms!ParamForm!FindRig

As criteria in the query Invoice Date field write:
forms!Paramform!InvoiceDate

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the selection of theRig and the entry
of the Invoice date wanted.
Click the command button and then report will run.
When the report closes, it will close the form.
 
S

stephendeloach

OK.. When i click "Drilling Report" the "ParamForm" comes up and has a text
box to "Invoice Date" and "Rig Name". I enter date and name then click the
"Run Query" command box. "Drilling Report" comes up but none of my fields
have data in them (#error)?

Heres what I have typed in...

Queries - "Drilling"
Date criteria - [forms]![Paramform]![InvoiceDate]
Rig criteria - [forms]![ParamForm]![FindRig]

Forms - "ParamForm"
I have 2 unbound text boxes:
Invoice Date:
Rig Name:

On Click:...
Private Sub Invoice_Date_Click()
Me.Visible = False
End Sub



Reports - "Drilling Report"
On Open:...
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "ParamForm", , , , , acDialog
End Sub

On Close:...
Private Sub Report_Close()
DoCmd.Close acForm, "ParamForm"
End Sub


NOW...
IF I click "Drilling Report".. the "ParamForm" opens... IF I click the X, the
"ParamForm" closes, a new box pops up... "Enter Perameter Value" - Forms!
ParamForm!InvoiceDate.. i enter 3/18/2007, click OK. ANOTHER box pops up..
"Enter Peramter Value" - Forms!ParamForm!FindRig... i enter Tiger (name of
oil rig), click OK. My "Drilling Report" comes up perfect.....?! So i guess
what i am asking is how to make one "Enter Perameter Value" box come up with
"InvoiceDate" and "FindRig"...?

I am wanting to add a box that pops up when i click on a report. When i click
on Drilling Invoice (name of report) i want it to have a box that asks "Date
[quoted text clipped - 3 lines]
pops up with ending date, enter ending date..click enter. then rig name pops
up... how can i make all of these on the same box?

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
RigID field and the RigName.
Name the Combo Box 'FindRig'.
Set it's Bound column to 1.
Set it's Column Count property to 2.
Set the Column Width property to 0";1"

Also add an unbound text control.
Set it's format to a valid date format.
Name this control "InvoiceDate".
Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Query that is used as the Report's Record Source [RigID] field
criteria line write:
forms!ParamForm!FindRig

As criteria in the query Invoice Date field write:
forms!Paramform!InvoiceDate

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the selection of theRig and the entry
of the Invoice date wanted.
Click the command button and then report will run.
When the report closes, it will close the form.
 
F

fredg

OK.. When i click "Drilling Report" the "ParamForm" comes up and has a text
box to "Invoice Date" and "Rig Name". I enter date and name then click the
"Run Query" command box. "Drilling Report" comes up but none of my fields
have data in them (#error)?

Heres what I have typed in...

Queries - "Drilling"
Date criteria - [forms]![Paramform]![InvoiceDate]
Rig criteria - [forms]![ParamForm]![FindRig]

Forms - "ParamForm"
I have 2 unbound text boxes:
Invoice Date:
Rig Name:

On Click:...
Private Sub Invoice_Date_Click()
Me.Visible = False
End Sub

Reports - "Drilling Report"
On Open:...
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "ParamForm", , , , , acDialog
End Sub

On Close:...
Private Sub Report_Close()
DoCmd.Close acForm, "ParamForm"
End Sub

NOW...
IF I click "Drilling Report".. the "ParamForm" opens... IF I click the X, the
"ParamForm" closes, a new box pops up... "Enter Perameter Value" - Forms!
ParamForm!InvoiceDate.. i enter 3/18/2007, click OK. ANOTHER box pops up..
"Enter Peramter Value" - Forms!ParamForm!FindRig... i enter Tiger (name of
oil rig), click OK. My "Drilling Report" comes up perfect.....?! So i guess
what i am asking is how to make one "Enter Perameter Value" box come up with
"InvoiceDate" and "FindRig"...?
I am wanting to add a box that pops up when i click on a report. When i click
on Drilling Invoice (name of report) i want it to have a box that asks "Date
[quoted text clipped - 3 lines]
pops up with ending date, enter ending date..click enter. then rig name pops
up... how can i make all of these on the same box?

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
RigID field and the RigName.
Name the Combo Box 'FindRig'.
Set it's Bound column to 1.
Set it's Column Count property to 2.
Set the Column Width property to 0";1"

Also add an unbound text control.
Set it's format to a valid date format.
Name this control "InvoiceDate".
Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Query that is used as the Report's Record Source [RigID] field
criteria line write:
forms!ParamForm!FindRig

As criteria in the query Invoice Date field write:
forms!Paramform!InvoiceDate

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the selection of theRig and the entry
of the Invoice date wanted.
Click the command button and then report will run.
When the report closes, it will close the form.

1) Do you have data returned if you use NO criteria?

2) I notice that as the Query criteria, you are using
[forms]![ParamForm]![FindRig]
but you named the control on the form "RigName".

If the name of the control on the form is actually "RigName" then
change the criteria to:
[forms]![ParamForm]![RigName]

3) Does the datatype in the bound columne of the [FindRig] combo box
match the datatype of the field in the query that it is being used as
criteria, i.e. Long to Long, or Text to Text?

4) Is the IvoiceDate field in the query a Date datatype field? Or a
Text datatype? It should be date datatype.

5) If checking these points doesn't help, all I can suggest is that
you post the exact query SQL.
 
S

stephendeloach via AccessMonster.com

still cant figure it out... thanks for your help tho.
OK.. When i click "Drilling Report" the "ParamForm" comes up and has a text
box to "Invoice Date" and "Rig Name". I enter date and name then click the
[quoted text clipped - 80 lines]
1) Do you have data returned if you use NO criteria?

2) I notice that as the Query criteria, you are using
[forms]![ParamForm]![FindRig]
but you named the control on the form "RigName".

If the name of the control on the form is actually "RigName" then
change the criteria to:
[forms]![ParamForm]![RigName]

3) Does the datatype in the bound columne of the [FindRig] combo box
match the datatype of the field in the query that it is being used as
criteria, i.e. Long to Long, or Text to Text?

4) Is the IvoiceDate field in the query a Date datatype field? Or a
Text datatype? It should be date datatype.

5) If checking these points doesn't help, all I can suggest is that
you post the exact query SQL.
 
G

germaine.oliver

still cant figure it out... thanks for your help tho.




OK.. When i click "Drilling Report" the "ParamForm" comes up and has a text
box to "Invoice Date" and "Rig Name". I enter date and name then click the
[quoted text clipped - 80 lines]
Click the command button and then report will run.
When the report closes, it will close the form.
1) Do you have data returned if you use NO criteria?
2) I notice that as the Query criteria, you are using
[forms]![ParamForm]![FindRig]
but you named the control on the form "RigName".
If the name of the control on the form is actually "RigName" then
change the criteria to:
[forms]![ParamForm]![RigName]
3) Does the datatype in the bound columne of the [FindRig] combo box
match the datatype of the field in the query that it is being used as
criteria, i.e. Long to Long, or Text to Text?
4) Is the IvoiceDate field in the query a Date datatype field? Or a
Text datatype? It should be date datatype.
5) If checking these points doesn't help, all I can suggest is that
you post the exact query SQL.

As I look at your query parameters, is Forms!ParamForm!(control name)
EXACTLY the same as the control name on your form? It looks like you
might have spaces in the names on your form, and no spaces in the name
on the query. Also, make sure you go with the name of the control that
has the data (the text box), not the label. I've seen it where the
label says something like "Employee SSN", so that's used as the
parameter, when the text box is called something like "txtEmSSN". Hope
that helps.
 
S

stephendeloach via AccessMonster.com

Yes it is all the same.. When I change the information from the address to
TSWS (the company being billed),TSWS is pulled in the report no problem...
But when it is more than one line (address) it says #ERROR....

still cant figure it out... thanks for your help tho.
[quoted text clipped - 28 lines]
- Show quoted text -

As I look at your query parameters, is Forms!ParamForm!(control name)
EXACTLY the same as the control name on your form? It looks like you
might have spaces in the names on your form, and no spaces in the name
on the query. Also, make sure you go with the name of the control that
has the data (the text box), not the label. I've seen it where the
label says something like "Employee SSN", so that's used as the
parameter, when the text box is called something like "txtEmSSN". Hope
that helps.
 

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