This is an old revision of the document!
Table of Contents
Replacing the Calendar Control in Access 2010 Applications
Calendar control
From: http://msdn.microsoft.com/en-us/library/office/gg251104%28v=office.14%29.aspx
Microsoft Access has included a Calendar control since it first added support for ActiveX controls, in Access 2.0. The calendar control, MSCAL.OCX, is not included with Access 2010.
Consider the following pros and cons of each option: Built-in date picker Simple to use (requires only setting the ShowDatePicker property). No customization available. Works only with TextBox controls bound to a Date field in a table. DatePicker Control Reasonably easy to use. Allows more customization than the built-in date picker. Can also be used to select times. Can be bound to a data source. Depends on the Microsoft Custom Controls DLL, which introduces serious versioning issues. Your end-users may not have the same version of the DLL installed as you do, and this requires updating their DLL to the latest version. Only appears as a drop-down, and cannot appear as an open calendar. Calendar Form Appears only as an open calendar (both a pro and a con). Completely customizable, but requires some work in the designer and in code. Easy to use─merely drag onto a form and write the code. Hooking up events requires additional code. Binding is not available without writing code.
Alternatives to SendKey
From: http://www.pcreview.co.uk/forums/alternative-sendkeys-keystrokes-f9-wait-yes-t3162974.html
DoCmd.GoToControl "Balance"
From: http://www.access-programmers.co.uk/forums/showthread.php?t=47212
By the way, in that code snippet, you might be wondering why moving the focus to the txtField field involves two steps: 1- Me.subForm.SetFocus and then, 2- Me.subForm.Form.Controls("txtField").SetFocus
num lock keeps shutting off
From: http://support.microsoft.com/kb/179987
Multiple Sendkeys
From: http://bytes.com/topic/access/answers/943432-sendkeys-turns-off-numlock
SendKeys statement activates, the NumLock status automatically turns OFF
How to solve missing MSCAL.OCX reference in Microsoft Access 2010
However note, that the solution specified is a work-around for the above problem. Microsoft has stated that the Calendar control feature is deprecated in Access 2010 and has suggested a number of options for replacing it. See the link referenced at the bottom of this page for more details Centerport
Forms: Date Picker without ActiveX
From: http://access.mvps.org/access/forms/frm0057.htm
Forms: Date Picker without ActiveX; I have a form with a date field or a block of code that needs to input a date and I want to the user to have a calendar view to select that date from. I don't want to use any ActiveX components.
(A) Use the Access Date Picker.
wildcards for SQL
From: http://msdn.microsoft.com/en-us/library/office/aa140104(v=office.10).aspx
The pattern-matching characters we looked at last month were provided through DAO. Rather than using the asterisk (*) and question mark (?) symbols as wildcards, ADO requires that you use the percent sign (%) to match multiple characters and the underscore (_) to match a single character. There's no single-digit wildcard available through ADO that equates to DAO's pound sign wildcard (#); however, character lists and ranges behave the same.
split for openargs
visual-basic-combo-box-tutorial
http://www.vb6.us/tutorials/visual-basic-combo-box-tutorial
http://www.mvps.org/access/api/api0002.htm
For an action query you might do something like:
Dim strSQL As String strSQL = “Delete * From MyTable Where ID =” & Me.txtID CurrentDB.Execute strSQL
You can also use DoCmd.RunSQL: DoCmd SetWarning False DoCmd.RunSQL strSQL DoCmd SetWarning True
Or you might build a recordset:
Dim rst As DAO.Recordset Dim db As DAO.Database Dim strSQL As String
strSQL = “Select * From MyTable” Set db = CurrentDB Set rst = db.OpenRecordset(strSQL, dbOpenSnapshot)