[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Msgbox Error

Posted on 2006-11-13
4
Medium Priority
?
655 Views
Last Modified: 2008-03-03
The function below checks to see if information pertaining to last quarter schedules were filled, if missing
a msgbox pops from an "On Open Event handler..

Everything works fine except that the last line of the msgbox adds "zero" to the end of the message.
.....this line...code adds zero when the message actually displays to user

'-->> It reads "Please contact your Administrator.0   '<<<---


Here is the "On Open Event handler code"

' .............................
' ............................
    'Check if filing date entered for relevant quarter
    rptFiled = checkFilingDate(qtrNum, yrNum)
   
    ' if no filing date and not in grace period
    If rptFiled = False And notifPeriod = False Then
        MsgBox "You cannot proceed as no filing date has been entered" & vbCrLf & _
               "for quarter " & qtrNum & " " & yrNum & "." & vbCrLf & _
               "Please contact your administrator." & vbOKOnly
       
        DoCmd.Close
' ..............................
' ..............................

' **********
Function checkFilingDate(qtr As Integer, yr As Integer) As Boolean
' function to check if a date has been entered in the relevant quarter

If Nz(DLookup("[DateFiled]", "tblFilingDates", "[QtrNo]=" & qtr & " And [YearNum]=" & yr), "") = "" Then
        checkFilingDate = False
    Else
        checkFilingDate = True
    End If

End Function
0
Comment
Question by:billcute
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 65

Accepted Solution

by:
rockiroads earned 2000 total points
ID: 17928911
bill, if u want to see buttons, its the 2nd parameter to msgbox

what u have done is appended it to the first

MsgBox "You cannot proceed as no filing date has been entered" & vbCrLf & _
               "for quarter " & qtrNum & " " & yrNum & "." & vbCrLf & _
               "Please contact your administrator." & vbOKOnly

should be

MsgBox "You cannot proceed as no filing date has been entered" & vbCrLf & _
               "for quarter " & qtrNum & " " & yrNum & "." & vbCrLf & _
               "Please contact your administrator." ,  vbOKOnly


0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17928916
U can add icons to the 2nd parameter and a third parameter also, a title for your msgbox


MsgBox "You cannot proceed as no filing date has been entered" & vbCrLf & _
               "for quarter " & qtrNum & " " & yrNum & "." & vbCrLf & _
               "Please contact your administrator." , vbOKOnly + vbExclamation, "Ooops"


here we display exclamation mark in the msgbox with a title captiond "Ooops"


0
 
LVL 4

Author Comment

by:billcute
ID: 17928952
Thanks..your answer resolved the problem..

Regards
Bill
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17928964
No probs
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question