Access: DLookup

========= QUESTION --------- How do I use the value from the field of one table as the criteria in a query against a different table? How do I use the DLookup function?   ========= ANSWER --------- See EXAMPLES   ========= EXAMPLES --------- Number Fields:DLookup("FieldName" , "TableName" , "Criteria = n") Text Fields: DLookup("FieldName" , "TableName" , "Criteria= 'string'") Date [...]

By |2017-12-01T23:47:41+00:00June 13th, 2011|Access, Computers, Documentation, Microsoft|Comments Off on Access: DLookup

Access: Run-time error 13 Type MisMatch

========= QUESTION --------- I converted a Microsoft Access database from .mdb to .accdb format, and now when I run my usual VBA code to export a report to PDF, it gives me the error: Run-time error ‘13’: Type mismatch   ========= ANSWER --------- If you are not using an ADO object library, clear the reference to [...]

By |2017-12-01T23:47:41+00:00June 7th, 2011|Access, Computers, Documentation, Microsoft, VBA|Comments Off on Access: Run-time error 13 Type MisMatch

Access VBA: Export to Spreadsheet

========= QUESTION --------- How do I export to a spreadsheet using VBA?   ========= ANSWER --------- See EXAMPLES   ========= EXAMPLES --------- MyFilePath = "C:Test" Me.Status = "Creating Spreadsheet file" Me.Repaint DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "ReportOrQueryName", MyFilePath & "FileName.xls" --------- Me.CurrentStatus = _ "Exporting to Excel for Distribution" & vbCrLf & _ Now() & vbCrLf & _ vbCrLf & _ [...]

By |2011-06-07T17:47:17+00:00June 7th, 2011|Access, Computers, Documentation, Microsoft, VBA|Comments Off on Access VBA: Export to Spreadsheet

Access VBA: Date modified of table

========= QUESTION --------- I want to show the date the table was last modified   ========= ANSWER --------- See EXAMPLES   ========= EXAMPLES --------- Me.Signature2.Value = CurrentDb.TableDefs("ControlPanel").Properties("LastUpdated")   ========= APPLIES TO / KEY WORDS --------- Microsoft Access VBA Date Modified   ========= REF --------- http://www.accessmonster.com/Uwe/Forum.aspx/access-modulesdaovba/30880/Access-VBA-Date-Modified   ---http://www.anysitesupport.com/access-vba-date-modified-of-table/ http://anySiteHosting.com

By |2017-12-01T23:47:48+00:00May 23rd, 2011|Access, Computers, Documentation, Microsoft, VBA|Comments Off on Access VBA: Date modified of table

Access: View System Tables

========= QUESTION --------- How do I view System Tables or objects in Microsoft Access?   ========= ANSWER --------- Access 2007 Right-click (Shift + F10) the top of the Navigation Pane on the left side of the screen Select Navigation Options Choose your options in the Display Options in the lower left of the Navigation Options [...]

By |2017-12-01T23:47:48+00:00May 20th, 2011|Access, Computers, Documentation, Microsoft|Comments Off on Access: View System Tables

Access VBA: How to copy a table

========= QUESTION --------- How do I copy a table using VBA or SQL in Access?   ========= ANSWER --------- See EXAMPLES NOTE: the use of of the square brackets ("[" and "]") will save you a lot of grief! For instance in the example below, the date formatting having hyphens in it screws up the [...]

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

Access: How do I open a new email message from VBA?

========= QUESTION ---------How do I open a new email message from VBA?   ========= ANSWER ---------See EXAMPLES   ========= EXAMPLES ---------Dim olLook As Object 'Start MS OutlookDim olNewEmail As Object 'New email in OutlookDim strContactEmail As String 'Contact email address Set olLook = CreateObject("Outlook.Application")Set olNewEmail = olLook.createitem(0)strEmailSubject = "TopSellers.accdb Application"strEmailText = ""strContactEmail = NAME@DOMAIN With [...]

By |2011-05-05T09:08:36+00:00May 5th, 2011|Access, Computers, Documentation, Microsoft, VBA|Comments Off on Access: How do I open a new email message from VBA?

Access: VBA to open Internet Explorer

========= QUESTION ---------How do I open a web site from VBA? How do I open a url from VBA? How do I use VBA to open Internet Explorer?   ========= ANSWER ---------See Examples   ========= EXAMPLES ---------Private Sub ViewURL_Click() Set browser = CreateObject("InternetExplorer.Application")browser.Navigate ("http://www.Google.com")browser.StatusBar = Falsebrowser.Toolbar = Falsebrowser.Visible = Truebrowser.Resizable = Falsebrowser.AddressBar = True End [...]

By |2011-05-04T10:47:37+00:00May 4th, 2011|Access, Documentation, Microsoft, VBA|Comments Off on Access: VBA to open Internet Explorer

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
Go to Top