Solved

Msgbox Error

Posted on 2006-11-13
4
639 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
  • 3
4 Comments
 
LVL 65

Accepted Solution

by:
rockiroads earned 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now