av8tordude
08-21-2010, 12:17 PM
Is it possible for a message to display once and not trigger again if Need4 label or Need5 label is visible? currently the msgbox triggers each time an event is changed
Public Sub Enable_Enter_Button()
If Len(Trim(frmPDCalc.cboCntry.Value)) = 0 Then
frmPDCalc.Ent1.Enabled = True
Else
If UCase(Trim(frmPDCalc.cboCntry.Value)) = "UNITED STATES" Then
If CDate(frmPDCalc.Date1.Value) > Sheets("Calculator").Range("T8") Then
frmPDCalc.Need4.Visible = True
frmPDCalc.Need5.Visible = False
frmPDCalc.Rate1 = "$0.00"
frmPDCalc.Ent1.Enabled = False
If CDate(frmPDCalc.Date1.Value) < Format(CDate("30-Sep-" & Year(frmPDCalc.Date1)), "mm/dd/yyyy") Then
MsgBox "The Domestic Per Diem Rates Database Has Expired. You Must Download The Per Diem Rates for: " & vbLf & _
"" & vbLf & _
" Fiscal Year: " & Format(frmPDCalc.Date1, "yyyy") & "", vbExclamation, "FlightLog - Professional Edition"
Else
If CDate(frmPDCalc.Date1.Value) > Format(CDate("30-Sep-" & Year(frmPDCalc.Date1)), "mm/dd/yyyy") Then
MsgBox "The Domestic Per Diem Rates Database Has Expired. You Must Download The Per Diem Rates for: " & vbLf & _
"" & vbLf & _
" Fiscal Year: " & Format(frmPDCalc.Date1, "yyyy") + 1 & "", vbExclamation, "FlightLog - Professional Edition"
End If
End If
Else
frmPDCalc.Ent1.Enabled = True
frmPDCalc.Need4.Visible = False
frmPDCalc.Need5.Visible = False
End If
Else
If CDate(frmPDCalc.Date1.Value) > Sheets("Calculator").Range("Z8") Then
frmPDCalc.Need4.Visible = False
frmPDCalc.Need5.Visible = True
frmPDCalc.Rate1 = "$0.00"
frmPDCalc.Ent1.Enabled = False
MsgBox "The International Per Diem Rates Database Has Expired. You Must Download The Per Diem Rates for: " & vbLf & _
"" & vbLf & _
" " & UCase(Format(DateSerial(Year(CDate(frmPDCalc.Date1.Value)), Month(CDate(frmPDCalc.Date1.Value)), 1), "mmmm yyyy")) & "", vbExclamation, "FlightLog - Professional Edition"
Else
frmPDCalc.Ent1.Enabled = True
frmPDCalc.Need4.Visible = False
frmPDCalc.Need5.Visible = False
End If
End If
End If
End Sub
Public Sub Enable_Enter_Button()
If Len(Trim(frmPDCalc.cboCntry.Value)) = 0 Then
frmPDCalc.Ent1.Enabled = True
Else
If UCase(Trim(frmPDCalc.cboCntry.Value)) = "UNITED STATES" Then
If CDate(frmPDCalc.Date1.Value) > Sheets("Calculator").Range("T8") Then
frmPDCalc.Need4.Visible = True
frmPDCalc.Need5.Visible = False
frmPDCalc.Rate1 = "$0.00"
frmPDCalc.Ent1.Enabled = False
If CDate(frmPDCalc.Date1.Value) < Format(CDate("30-Sep-" & Year(frmPDCalc.Date1)), "mm/dd/yyyy") Then
MsgBox "The Domestic Per Diem Rates Database Has Expired. You Must Download The Per Diem Rates for: " & vbLf & _
"" & vbLf & _
" Fiscal Year: " & Format(frmPDCalc.Date1, "yyyy") & "", vbExclamation, "FlightLog - Professional Edition"
Else
If CDate(frmPDCalc.Date1.Value) > Format(CDate("30-Sep-" & Year(frmPDCalc.Date1)), "mm/dd/yyyy") Then
MsgBox "The Domestic Per Diem Rates Database Has Expired. You Must Download The Per Diem Rates for: " & vbLf & _
"" & vbLf & _
" Fiscal Year: " & Format(frmPDCalc.Date1, "yyyy") + 1 & "", vbExclamation, "FlightLog - Professional Edition"
End If
End If
Else
frmPDCalc.Ent1.Enabled = True
frmPDCalc.Need4.Visible = False
frmPDCalc.Need5.Visible = False
End If
Else
If CDate(frmPDCalc.Date1.Value) > Sheets("Calculator").Range("Z8") Then
frmPDCalc.Need4.Visible = False
frmPDCalc.Need5.Visible = True
frmPDCalc.Rate1 = "$0.00"
frmPDCalc.Ent1.Enabled = False
MsgBox "The International Per Diem Rates Database Has Expired. You Must Download The Per Diem Rates for: " & vbLf & _
"" & vbLf & _
" " & UCase(Format(DateSerial(Year(CDate(frmPDCalc.Date1.Value)), Month(CDate(frmPDCalc.Date1.Value)), 1), "mmmm yyyy")) & "", vbExclamation, "FlightLog - Professional Edition"
Else
frmPDCalc.Ent1.Enabled = True
frmPDCalc.Need4.Visible = False
frmPDCalc.Need5.Visible = False
End If
End If
End If
End Sub