Monday, September 26, 2016

Troubleshooter of Error: Date range

Date range

My code below is not working exactly as hoped.
I want the report to display only the records for the selected month.
But currently id also shows records prior to the Start Date.
Also If I select February (which of course is past) I want to see the records to February of next year.
Private Sub Command229_Click()
Dim dtmStart As Date
 Dim dtmEnd As Date
 Dim strCriteria As String
 Dim intMonth As Integer
intMonth = Me.Frame188
If intMonth = 13 Then
    GoTo Skip
End If
' get first of current month
dtmStart = DateSerial(2000, 1, 31)

' get day following last day of selected month, adjusting by year
 dtmEnd = DateSerial(Year(VBA.Date) + IIf(intMonth < Month(VBA.Date), 1, 0), intMonth + 1, 1)
' build criteria string expression
 strCriteria = "[MaxOfCalDueDate]>=#" & Format(dtmStart, "yyyy-mm-dd") & "# " & _
     "And [MaxOfCalDueDate] < #" & Format(dtmEnd, "yyyy-mm-dd") & "#"
' open report in print preview
 DoCmd.OpenReport "Copy of rptCalibrationDueReport", View:=acViewPreview, WhereCondition:=strCriteria
End Sub

Anwsers to the Problem Date range

Download Error Fixer for Free Now

Try this version:
Private Sub Command229_Click()
    Dim lngYear As Long
    Dim lngMonth As Long
    Dim strCriteria As String

    lngMonth = Me.Frame188
    If intMonth < 13 Then
        lngYear = Year(Date) - (lngMonth < Month(Date))
        ' build criteria string expression
        strCriteria = "Month([MaxOfCalDueDate])=" & lngMonth & _
            " AND Year([MaxOfCalDueDate])=" & lngYear
    End If

    ' open report in print preview
    DoCmd.OpenReport "Copy of rptCalibrationDueReport", View:=acViewPreview, WhereCondition:=strCriteria
End Sub

Machine Throttling
  • Click the Start button.
  • In the Search box, type "regedit" (without quotes) and press Enter.
  • Look for the following registry key: "HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\ SQMClient\Windows\DisabledSessions".
  • On the right window pane, delete the subkey: "Machine Throttling".
  • Restart your system.

Recommended Method to Fix the Problem: Date range:

How to Fix Date range with SmartPCFixer?

1. You can Download SmartPCFixer here. Install it on your computer. When you open it, it will perform a scan.

2. After the scan is finished, you can see the errors and problems which need to be fixed.

3. The Fixing part is done, the speed of your computer will be much higher than before and the errors have been fixed.

Related: How to Update & Download NVidia GeForce 6100/nForce 420 WHQL Certified driver v.178.13,How to Update & Download NVidia GeForce 7600 GS Video Driver v.295.75 Certified,How Can I Update & Download NVidia GeForce 820M Driver v.344.48 WHQL,[Solved] Download NVidia GeForce GTX 560M VGA Driver v.296.17 Certified,Way to Update & Herunterladen NVidia GeForce GT 130M Video Treiber v.295.75 Certified,How to Update & Download SONY SVE14A1X1RH Realtek Ethernet Driver,Where to Download SONY SVS13A2W9ES Bluetooth Driver (Intel) v.2.6 -,Best Way to Update & Download SONY VGN-CR203E Conexant HDAUDIO SoftV92 Data Fax Modem with SmartCP Setup Program v. driver,Best Way to Download SONY VGN-FE790G/N Wireless LAN Driver v.,Method to Update & Download SONY VGN-NR31Z/S Firmware Extension Parser Device v.,How to Fix Error 0x0000c1f5 Solución?,Error 0x80071a91 Win7 Fix Patch,Error 0x800ccc60 Windows Live Mail [Solved],Error Message 0x800ccc79 Outlook 2000 Fix,What is Error 0xc1ab0001?,[Answered] x64 saplugin dll,How to Fix Problem - Kb943729 Download?,Troubleshooting: Bccode D1 Error,Java Runtime Tech Support,Troubleshooting: ERROR NO SUCH GROUP Error
Read More: How Can I Fix - Desktop Background pictures does not fit full screen?,[Solved] Customizing folders icons on the desktop,DDE no longer works on Vista [Anwsered],How Can I Fix - Default Bullets Changed in Word 2010?,How to Fix - Desktop icons open Windows Media Player instead?

No comments:

Post a Comment