Popup warning

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ok I have looked at most of the recent posts and didn't find the answer yet.
I have a form that contains an unbound text box "txtTowId" The report is
based on a query in the criteria is "=forms!frmMain!frmRptSingle!txtTowId"
when the print button on the form is clicked the report opens in print
preview and displays correctly all is well; however in the query is field for
a date. now what i'd like to be able to do is when the print button is
clicked have a popup warning that will warn if the date field is null. I am
asking to much or is there an easy way to do this.

Attached is the sql statement:
SELECT tblTow.strTag, tblTow.strDateIn, tblTow.strReleased, tblTow.strPick,
tblTow.strDateOut, tblTow.strTowCharges, tblTow.strLienFees, tblTow.strLien,
tblTow.strLienFees, tblTow.strStorage, tblTow.strLabor, tblTow.strStored,
tblTow.strImpound, tblTow.strSalvage, tblTow.strComplete, tblTow.strVinCheck,
tblVechicle.strVin, tblVechicle.strLic, tblVechicle.strLicState,
tblVechicle.strMake, tblVechicle.strModel, tblVechicle.strColor,
tblVechicle.strYear, tblOwner.strFirst, tblOwner.strLast, tblOwner.strAddNum,
tblOwner.strStrtName, tblOwner.strCity, tblOwner.strState, tblOwner.strZip,
tblOwner.strPhone, [strFirst] & " " & [strLast] AS Name, [strAddNum] & " " &
[strStrtName] & " " & [strCity] & " " & [strState] & " " & [strZip] AS
Address, tblFees.strDailyFees
FROM tblFees, (tblTow INNER JOIN tblOwner ON tblTow.strTag =
tblOwner.strTag) INNER JOIN tblVechicle ON tblTow.strTag = tblVechicle.strTag
WHERE (((tblTow.strTag)=[Forms]![frmMain]![frmRpt1]![txtTowId]));
 
Is the "date" field the strDateIn field in tblTow?

I'm not clear about wanting a "popup" warning if the "date" field is blank.
A query cannot cause a message box to be shown (except if you set up a
calculated field in the query and that calculated field calls a function
that checks data and displays a message box -- but this would not be a good
way to give a message to the user, believe me).

A report can display information based on the value in a field, so you could
have a label/textbox be made visible on the report for records where the
"date" field is Null. Is that what you seek?

If not, tell us more about what you want the user to do if a message box
pops up -- does the user have to enter a value somewhere? does the user
ignore the info? does the query fail to work? etc.
 
I figured it would confusing. the whole program track cars that are towed and
in storage among all of the features of the program is one that allows the
user to print a report for a single vehicle. when the information is first
entered a date is entered ie datein if the user tries to print the report
without entering the ending date the program uses the current date to
calculate storage fees anyway what I wanted was sort of a error message that
would warn the user if the date out field had not been completed when the
user attempts to print the report. hopefully this makes sense.

the field in question is the "strDateOut"

thank you

Ken Snell (MVP) said:
Is the "date" field the strDateIn field in tblTow?

I'm not clear about wanting a "popup" warning if the "date" field is blank.
A query cannot cause a message box to be shown (except if you set up a
calculated field in the query and that calculated field calls a function
that checks data and displays a message box -- but this would not be a good
way to give a message to the user, believe me).

A report can display information based on the value in a field, so you could
have a label/textbox be made visible on the report for records where the
"date" field is Null. Is that what you seek?

If not, tell us more about what you want the user to do if a message box
pops up -- does the user have to enter a value somewhere? does the user
ignore the info? does the query fail to work? etc.
--

Ken Snell
<MS ACCESS MVP>


LtFass said:
Ok I have looked at most of the recent posts and didn't find the answer
yet.
I have a form that contains an unbound text box "txtTowId" The report is
based on a query in the criteria is "=forms!frmMain!frmRptSingle!txtTowId"
when the print button on the form is clicked the report opens in print
preview and displays correctly all is well; however in the query is field
for
a date. now what i'd like to be able to do is when the print button is
clicked have a popup warning that will warn if the date field is null. I
am
asking to much or is there an easy way to do this.

Attached is the sql statement:
SELECT tblTow.strTag, tblTow.strDateIn, tblTow.strReleased,
tblTow.strPick,
tblTow.strDateOut, tblTow.strTowCharges, tblTow.strLienFees,
tblTow.strLien,
tblTow.strLienFees, tblTow.strStorage, tblTow.strLabor, tblTow.strStored,
tblTow.strImpound, tblTow.strSalvage, tblTow.strComplete,
tblTow.strVinCheck,
tblVechicle.strVin, tblVechicle.strLic, tblVechicle.strLicState,
tblVechicle.strMake, tblVechicle.strModel, tblVechicle.strColor,
tblVechicle.strYear, tblOwner.strFirst, tblOwner.strLast,
tblOwner.strAddNum,
tblOwner.strStrtName, tblOwner.strCity, tblOwner.strState,
tblOwner.strZip,
tblOwner.strPhone, [strFirst] & " " & [strLast] AS Name, [strAddNum] & "
" &
[strStrtName] & " " & [strCity] & " " & [strState] & " " & [strZip] AS
Address, tblFees.strDailyFees
FROM tblFees, (tblTow INNER JOIN tblOwner ON tblTow.strTag =
tblOwner.strTag) INNER JOIN tblVechicle ON tblTow.strTag =
tblVechicle.strTag
WHERE (((tblTow.strTag)=[Forms]![frmMain]![frmRpt1]![txtTowId]));
 
You'll need to change your approach a little bit. From your description, it
sounds as if your query is prompting the user to enter an "out date" by a
parameter box. What you'll need to do is use a form for the user's input of
the information needed by the query, and then let the query read the data
from the form. You'll then be able to have the form be your "interface" that
will tell the user that a value is needed and to then not run the report.

You can do this by creating a form and putting textboxes on it for the
values. Put a command button on the form, and use the button's Click event
to run the code to generate the report. The first thing the code does is
test for the entry of values in all the textboxes:

Private Sub CommandButtonName_Click()
If Len(Me.TextBox1.Value & "") = 0 Then
MsgBox "Enter a value in textbox1!"
ElseIf Len(Me.TextBox2.Value & "") = 0 Then
MsgBox "Enter a value in textbox2!"
Else
DoCmd.OpenReport "ReportName"
End If
End Sub

--

Ken Snell
<MS ACCESS MVP>

LtFass said:
I figured it would confusing. the whole program track cars that are towed
and
in storage among all of the features of the program is one that allows the
user to print a report for a single vehicle. when the information is first
entered a date is entered ie datein if the user tries to print the report
without entering the ending date the program uses the current date to
calculate storage fees anyway what I wanted was sort of a error message
that
would warn the user if the date out field had not been completed when the
user attempts to print the report. hopefully this makes sense.

the field in question is the "strDateOut"

thank you

Ken Snell (MVP) said:
Is the "date" field the strDateIn field in tblTow?

I'm not clear about wanting a "popup" warning if the "date" field is
blank.
A query cannot cause a message box to be shown (except if you set up a
calculated field in the query and that calculated field calls a function
that checks data and displays a message box -- but this would not be a
good
way to give a message to the user, believe me).

A report can display information based on the value in a field, so you
could
have a label/textbox be made visible on the report for records where the
"date" field is Null. Is that what you seek?

If not, tell us more about what you want the user to do if a message box
pops up -- does the user have to enter a value somewhere? does the user
ignore the info? does the query fail to work? etc.
--

Ken Snell
<MS ACCESS MVP>


LtFass said:
Ok I have looked at most of the recent posts and didn't find the answer
yet.
I have a form that contains an unbound text box "txtTowId" The report
is
based on a query in the criteria is
"=forms!frmMain!frmRptSingle!txtTowId"
when the print button on the form is clicked the report opens in print
preview and displays correctly all is well; however in the query is
field
for
a date. now what i'd like to be able to do is when the print button is
clicked have a popup warning that will warn if the date field is null.
I
am
asking to much or is there an easy way to do this.

Attached is the sql statement:
SELECT tblTow.strTag, tblTow.strDateIn, tblTow.strReleased,
tblTow.strPick,
tblTow.strDateOut, tblTow.strTowCharges, tblTow.strLienFees,
tblTow.strLien,
tblTow.strLienFees, tblTow.strStorage, tblTow.strLabor,
tblTow.strStored,
tblTow.strImpound, tblTow.strSalvage, tblTow.strComplete,
tblTow.strVinCheck,
tblVechicle.strVin, tblVechicle.strLic, tblVechicle.strLicState,
tblVechicle.strMake, tblVechicle.strModel, tblVechicle.strColor,
tblVechicle.strYear, tblOwner.strFirst, tblOwner.strLast,
tblOwner.strAddNum,
tblOwner.strStrtName, tblOwner.strCity, tblOwner.strState,
tblOwner.strZip,
tblOwner.strPhone, [strFirst] & " " & [strLast] AS Name, [strAddNum] &
"
" &
[strStrtName] & " " & [strCity] & " " & [strState] & " " & [strZip]
AS
Address, tblFees.strDailyFees
FROM tblFees, (tblTow INNER JOIN tblOwner ON tblTow.strTag =
tblOwner.strTag) INNER JOIN tblVechicle ON tblTow.strTag =
tblVechicle.strTag
WHERE (((tblTow.strTag)=[Forms]![frmMain]![frmRpt1]![txtTowId]));
 
Yes Ken I belive this approach will work nicely thank you very much. Actualy
the report is generated by a command button that when clicked opens the
report in print view. the information is taken from the query via a criteria
statement "Between [forms]![frmMain]![frmRpt1]![txtOne] And
[forms]![frmMain]![frmRpt1]![txtTwo]" and a calculated field "TotalStorage:
IIf(IsNull([strDateOut]),(Date()-[strDateIn])*[tblFees.strDailyFees],([strDateOut]-[strDateIn])*[tblFees.strDailyFees])"
so when the report is opened it doesn't actualy ask for the information.
However I like your approach again thank you very much it is a pleasure to
work with skilled and Knowledgeable people like yourself.

Cliff

Ken Snell (MVP) said:
You'll need to change your approach a little bit. From your description, it
sounds as if your query is prompting the user to enter an "out date" by a
parameter box. What you'll need to do is use a form for the user's input of
the information needed by the query, and then let the query read the data
from the form. You'll then be able to have the form be your "interface" that
will tell the user that a value is needed and to then not run the report.

You can do this by creating a form and putting textboxes on it for the
values. Put a command button on the form, and use the button's Click event
to run the code to generate the report. The first thing the code does is
test for the entry of values in all the textboxes:

Private Sub CommandButtonName_Click()
If Len(Me.TextBox1.Value & "") = 0 Then
MsgBox "Enter a value in textbox1!"
ElseIf Len(Me.TextBox2.Value & "") = 0 Then
MsgBox "Enter a value in textbox2!"
Else
DoCmd.OpenReport "ReportName"
End If
End Sub

--

Ken Snell
<MS ACCESS MVP>

LtFass said:
I figured it would confusing. the whole program track cars that are towed
and
in storage among all of the features of the program is one that allows the
user to print a report for a single vehicle. when the information is first
entered a date is entered ie datein if the user tries to print the report
without entering the ending date the program uses the current date to
calculate storage fees anyway what I wanted was sort of a error message
that
would warn the user if the date out field had not been completed when the
user attempts to print the report. hopefully this makes sense.

the field in question is the "strDateOut"

thank you

Ken Snell (MVP) said:
Is the "date" field the strDateIn field in tblTow?

I'm not clear about wanting a "popup" warning if the "date" field is
blank.
A query cannot cause a message box to be shown (except if you set up a
calculated field in the query and that calculated field calls a function
that checks data and displays a message box -- but this would not be a
good
way to give a message to the user, believe me).

A report can display information based on the value in a field, so you
could
have a label/textbox be made visible on the report for records where the
"date" field is Null. Is that what you seek?

If not, tell us more about what you want the user to do if a message box
pops up -- does the user have to enter a value somewhere? does the user
ignore the info? does the query fail to work? etc.
--

Ken Snell
<MS ACCESS MVP>


Ok I have looked at most of the recent posts and didn't find the answer
yet.
I have a form that contains an unbound text box "txtTowId" The report
is
based on a query in the criteria is
"=forms!frmMain!frmRptSingle!txtTowId"
when the print button on the form is clicked the report opens in print
preview and displays correctly all is well; however in the query is
field
for
a date. now what i'd like to be able to do is when the print button is
clicked have a popup warning that will warn if the date field is null.
I
am
asking to much or is there an easy way to do this.

Attached is the sql statement:
SELECT tblTow.strTag, tblTow.strDateIn, tblTow.strReleased,
tblTow.strPick,
tblTow.strDateOut, tblTow.strTowCharges, tblTow.strLienFees,
tblTow.strLien,
tblTow.strLienFees, tblTow.strStorage, tblTow.strLabor,
tblTow.strStored,
tblTow.strImpound, tblTow.strSalvage, tblTow.strComplete,
tblTow.strVinCheck,
tblVechicle.strVin, tblVechicle.strLic, tblVechicle.strLicState,
tblVechicle.strMake, tblVechicle.strModel, tblVechicle.strColor,
tblVechicle.strYear, tblOwner.strFirst, tblOwner.strLast,
tblOwner.strAddNum,
tblOwner.strStrtName, tblOwner.strCity, tblOwner.strState,
tblOwner.strZip,
tblOwner.strPhone, [strFirst] & " " & [strLast] AS Name, [strAddNum] &
"
" &
[strStrtName] & " " & [strCity] & " " & [strState] & " " & [strZip]
AS
Address, tblFees.strDailyFees
FROM tblFees, (tblTow INNER JOIN tblOwner ON tblTow.strTag =
tblOwner.strTag) INNER JOIN tblVechicle ON tblTow.strTag =
tblVechicle.strTag
WHERE (((tblTow.strTag)=[Forms]![frmMain]![frmRpt1]![txtTowId]));
 
You're welcome.

--

Ken Snell
<MS ACCESS MVP>

LtFass said:
Yes Ken I belive this approach will work nicely thank you very much.
Actualy
the report is generated by a command button that when clicked opens the
report in print view. the information is taken from the query via a
criteria
statement "Between [forms]![frmMain]![frmRpt1]![txtOne] And
[forms]![frmMain]![frmRpt1]![txtTwo]" and a calculated field
"TotalStorage:
IIf(IsNull([strDateOut]),(Date()-[strDateIn])*[tblFees.strDailyFees],([strDateOut]-[strDateIn])*[tblFees.strDailyFees])"
so when the report is opened it doesn't actualy ask for the information.
However I like your approach again thank you very much it is a pleasure to
work with skilled and Knowledgeable people like yourself.

Cliff

Ken Snell (MVP) said:
You'll need to change your approach a little bit. From your description,
it
sounds as if your query is prompting the user to enter an "out date" by a
parameter box. What you'll need to do is use a form for the user's input
of
the information needed by the query, and then let the query read the data
from the form. You'll then be able to have the form be your "interface"
that
will tell the user that a value is needed and to then not run the report.

You can do this by creating a form and putting textboxes on it for the
values. Put a command button on the form, and use the button's Click
event
to run the code to generate the report. The first thing the code does is
test for the entry of values in all the textboxes:

Private Sub CommandButtonName_Click()
If Len(Me.TextBox1.Value & "") = 0 Then
MsgBox "Enter a value in textbox1!"
ElseIf Len(Me.TextBox2.Value & "") = 0 Then
MsgBox "Enter a value in textbox2!"
Else
DoCmd.OpenReport "ReportName"
End If
End Sub

< snipped >
 
Back
Top