Navigation

Showing posts with label MS Access. Show all posts
Showing posts with label MS Access. Show all posts

3/28/2014

Using Count in Access report

In a Microsoft Access report, want to have numbered list, list with count along side of the items:


& IIf([Count_var]=Count(*),"  ",", ")

Define a text box Count_var, with Control Source =1, and Running Sum "Over Group"
















9/17/2013

Limit MS Access report by date

Have a Microsoft Access database with a report to display records, want to limit by a date range, entered by user.


http://allenbrowne.com/casu-08.html


http://www.tek-tips.com/viewthread.cfm?qid=1674898

http://bytes.com/topic/access/answers/869108-filter-report-date-range




9/21/2012

VBA code to ESC from Access Form entry

In Microsoft Access 2010 database, wanted to create button that did same as pressing ESC key;

Found blog post on Use code to "undo" things in Access 

DoCmd.RunCommand acCmdUndo

If there is nothing in the form, nothing can be UNdone, get error 2046.  Added error handling,  just close the form, and exit the subroutine.


Private Sub Button_Click()
On Error GoTo ErrorHandler
DoCmd.RunCommand acCmdUndo
DoCmd.Close acForm, "Faculty Purchases - FY 2012", acSaveYes
Exit Sub
ErrorHandler:

Select Case Err

         Case 2046:    ' Error 2046: "Nothing can be UNDOne"
                       
         DoCmd.Close acForm, "Faculty Purchases - FY 2012", acSaveYes
         Exit Sub
        
         Case Else:      ' An error other than 2046 has occurred.
            ' Display the error number and the error text.
            MsgBox "Error # " & Err & " : " & Error(Err)

      End Select
End Sub