Solved

Msgbox Error

Posted on 2006-11-13
4
643 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 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

740 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