Access: Export report to PDF using VBA

========= QUESTION ---------Using VBA, how do I export a report to PDF in Microsoft Access?   ========= ANSWER ---------Access 2010 option of opening report and outputting to PDF using the Access engine, not Adobe Acrobat Printer: see EXAMPLES --------- Other options: http://www.granite.ab.ca/access/pdffiles.htm   ========= EXAMPLES ---------Private Sub SendReports_Click() Me.CurrentStatus = "Sending Reports..." & vbCrLf & [...]

By |2011-05-04T10:05:40+00:00May 4th, 2011|Access, Computers, Documentation, Microsoft, VBA|Comments Off on Access: Export report to PDF using VBA

Access: Use VBA to copy files

========= QUESTION ---------How do I copy, move, rename files from within the VBA code of my Access project? --------- How do I write a file backup routine into my Microsoft Access project/form?   ========= ANSWER ---------See EXAMPLES   ========= EXAMPLES ---------        DoCmd.Hourglass True    DoCmd.SetWarnings False        'store a serial number in the parms table    'then read [...]

By |2017-12-01T23:47:49+00:00May 4th, 2011|Access, Computers, Documentation, Microsoft, VBA|Comments Off on Access: Use VBA to copy files

Access VBA: How do I delete all records in a table?

========= QUESTION ---------How do I delete all records in a table using VBA?   ========= ANSWER ---------Simply execute a SQL statement as follows: DELETE * FROM NameOfTable;   ========= EXAMPLES ---------Docmd.RunSQL "DELETE * FROM NameOfTable;"   ========= APPLIES TO / KEY WORDS ---------Microsoft Access VBA SQL Clear   ========= REF ---------http://www.access-programmers.co.uk/forums/archive/index.php/t-81194.html     ---http://www.anysitesupport.com/access-vba-how-do-i-delete-all-records-in-a-table/ http://anySiteHosting.com

By |2017-12-01T23:47:50+00:00April 26th, 2011|Access, Computers, Documentation, Microsoft, VBA|Comments Off on Access VBA: How do I delete all records in a table?

Access VBA: How do I display a field value?

=========EXAMPLES---------Set rst = CurrentDb.OpenRecordset("Parms")EOW = rst.EOWDateMe.CurrentStatus = "EOW Date set to " & EOW & vbcrlf rst is simply a name to hold your recordset where you are opening the table ParmsEOW is simply a name to hold the field you are querying ---http://www.anysitesupport.com/access-vba-how-do-i-display-a-field-value/

By |2017-12-01T23:47:51+00:00April 12th, 2011|Access, Computers, Documentation, Microsoft, VBA|Comments Off on Access VBA: How do I display a field value?

VBA: Check if table exists

=========QUESTION---------In Microsoft Access 2007, using VBA, how can you check to see if a table exists? =========EXAMPLES---------On Error Resume Next --------- Public Function dbsTableDelete(DBName)    Count = 0    tblNotFound = False    Do Until tblNotFound        If DBName = dbs2020.TableDefs(Count).Name Then            dbs2020.TableDefs.Delete (DBName)            Exit function        End If        Count = Count + 1        'Determine if we are at the [...]

By |2017-12-01T23:47:51+00:00April 7th, 2011|Access, Computers, Documentation, Microsoft, VBA|Comments Off on VBA: Check if table exists

VBA: Table Record Count

=========REF: http://www.pcreview.co.uk/forums/vba-table-record-count-t1104006.html�http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_26940281.html�http://classicasp.aspfaq.com/general/why-does-recordcount-return-as-1.html =========NOTES---------Be careful with the use of CurrentDb.TableDefs("TABLENAME").RecordCount option. It's only available to the system when it is using a certain cursorType in your calls to the database. The default cursorType is Forward-Only and will not show the RecordCount. The best option is to open a record set:     Set rst = CurrentDb.OpenRecordset ("6050c__DrawingWinners")Then check [...]

By |2017-12-01T23:47:52+00:00March 30th, 2011|Access, Computers, Documentation, Microsoft, VBA|Comments Off on VBA: Table Record Count

VBA: Time and Date Functions

=========QUESTION: How do I add date  and/or time values to Access queries, VBA, etc...?   =========EXAMPLES:---------Day of the week of a given Date:Day: Weekday([TransDate])Day: IIf(Weekday([TransDate])=1,"Sun", IIf(Weekday([TransDate])=2,"Mon", IIf(Weekday([TransDate])=3,"Tue", IIf(Weekday([TransDate])=4,"Wed", IIf(Weekday([TransDate])=5,"Thu", IIf(Weekday([TransDate])=6,"Fri", IIf(Weekday([TransDate])=7,"Sat","nada"))))))) ---------The current month:DateSerial(Year(Date()), Month(Date()), 1) The next month:DateSerial(Year(Date()), Month(Date()) + 1, 1) The last day of the current month:DateSerial(Year(Date()), Month(Date()) + 1, 0) The [...]

By |2011-03-28T09:27:22+00:00March 28th, 2011|Access, Computers, Documentation, Microsoft, VBA|Comments Off on VBA: Time and Date Functions
Go to Top