Access Programming in VBAConverting Number to Strings and String to Number, Formatingdim nAmount as currency, s as string s = FormatNumber(1234.5,2) nAmount = Nz(s, 0) ' OK nAmount = Val(s) ' NO - gives 1 Access ParametersBy default parameters are passed by reference, overide by using ByVal. Sub Proc1(ByVal a As String, b As String) ' b will be passed by reference
Runtime VersionUnhandled errors causes the program to shut down. Starting application with a /runtime switch to test behaviour. "C:\Program Files (x86)\Microsoft Office\Office12\MSACCESS.EXE" C:\PSS\Access\GPT\GPT.accdb /runtime
Saving Access Query to Excelsee code ADODB does not work with linked spreadsheets. Office 2007 Ribbon Documentationhttp://msdn.microsoft.com/en-gb/library/dd756403.aspx Access Autonumber ResetIn Access 2007 delete all data and then compact database autonumber fields are reset to start at 1. Access File Extensions.accde is locked version cannot be edit, VBA code removed only compile left. Not required for runtime..accdr creates a readonly version for full access to look like runtime environment - do this by simply renaming .accdb using Windows Explorer. File Search in Access 2007 : Scripting.FileSystemObjectThe FileSystemObject class has been removed from the Visual Basic for Applications object library for Access 2007. To use the FileSystemObject class, you must select Microsoft Scripting Run-time (Scrrun.dll) in the References dialog box for the project. http://support.microsoft.com/kb/935402 Access Form Sizes in Inches/Centimetres19" Monitor 1440 x 900 Access uses the screen dpi to convert twips (1/1440 inch) http://www.applecore99.com/api/api012.asp shows how to convert twips to pixels. Microsoft Entity Framework ASP.NetASP.Net Entity Framework does not support Access databases. Updating Excess Spreadsheets from Access VBAADODB does not support updates to linked spreadsheets. to be expanded with example Linking Access to FoxPro Database with ODBC
Dim sql As String, DBPath as string
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
DBPath = "C:\PSS\FoxPro\BrodexWT\Data\BR.dbc"
cn.Open "Driver={Microsoft Visual FoxPro Driver};" & _
"SourceType=DBC;" & _
"SourceDB=" & DBPath & ";" & _
"Exclusive=No"
rs.Open ADODBSQL("SELECT * FROM Customer WHERE Name " & SQLStrContains(Me.customerName) & " ORDER BY Name"), cn
Do While Not rs.EOF
Debug.Print rs!CustID & ";" & rs!Name & ";" & rs!address
rs.MoveNext
Loop
rs.Close
If you use a File DSN to import or link a FoxPro ODBC data source, you may receive the following error: Download FoxPro ODBC driver at: http://msdn.microsoft.com/en-us/vfoxpro/bb190233.aspx The recommended OLE DB driver is no use for Access. Stuff you can and cannot do with the VFP ODBC driver Access 2003 and 2007 on Same MachineOn a computer that has multiple versions of Access installed, the Windows Installer may start when you start Microsoft Office Access 2003 or Microsoft Office Access 2007. And, a "preparing to install" message or a "configuring" message may be displayed. You receive these messages before Access starts. The Windows Installer repair operation registers Access 2003 every time that you start Access 2003 after you use Access 2007. Similarly, the Windows Installer repair operation registers Access 2007 every time that you start Access 2007 after you use an earlier version of Access. Apart from occasion use this not practical. Consider using Windows Virtual PC for the older version of Access. Access 2000 and Access 2002 do not initiate a repair operation after you use a later version of Access. If the version of Access that you start is the same as the version of Access that you previously used, the Windows Installer repair operation does not occur. Access Secuity and Linked DatabasesOne option is to hide the linked database using windows explorer. The more secure option is to encrypt. Open backend db exclusive, encrypt, open front end delete all links and re-create - relinking does not work. Very good article: http://msdn.microsoft.com/en-us/library/bb421308(v=office.12).aspx
|
Resources Articles Access Database
|