VBA: Can you open Windows Explorer from VBA?

========= QUESTION --------- Can I open Windows Explorer from my VBA code?   ========= ANSWER --------- See EXAMPLES   ========= EXAMPLES --------- Private Sub WindowsExplorer_Click() Dim rst As RecordsetDim retval As String Set rst = CurrentDb.OpenRecordset("Parms")retval = Shell("explorer.exe " & rst!Path, vbNormalFocus)Set rst = NothingEnd Sub   ========= APPLIES TO / KEY WORDS --------- Microsoft [...]

By |2011-06-15T13:27:19+00:00June 15th, 2011|Access, Computers, Documentation, Microsoft, VBA|Comments Off on VBA: Can you open Windows Explorer from VBA?

VBA: How to put double quotes in a string

========= QUESTION --------- I need to have double quotes (") in a string in VBA, as I am entering WHERE statements in a SQL statement, but every time I have quotes in a string, it errors out.   ========= ANSWER --------- Any time you have double quotes ("), simply double them ("") and you will [...]

By |2017-12-01T23:47:41+00:00June 15th, 2011|Access, Documentation, Microsoft, VBA|Comments Off on VBA: How to put double quotes in a string

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