Showing posts with label MS Access. Show all posts
Showing posts with label MS Access. Show all posts

Jan 15, 2014

VBA Excel - Syntax for "for"

Syntax for "for":


For i = 4 To 2000 
    ' do something                
Next i 

MS Access - open form in another database

If you want to open a new form from another Access file you can use following code:

Public Sub OpenForeignForm()  
 Dim appAccess As Access.Application  
 Set appAccess = CreateObject("Access.Application")  
 appAccess.OpenCurrentDatabase "C:\MyPath\DataBaseName2.mdb"  
 appAccess.DoCmd.OpenForm "FormName"  
 Set appAccess = Nothing 
End Sub 

Dec 14, 2013

VBscript and ADO connection

We can connect to a MS Access file using vbscript. So we can run query into Access file, we can list data from Access into HTML using vbscript. The problem with that is … if we run HTML from a local drive it is OK. But if we try to access MS Access from the network then... we can have problems. I mean Warning messages for every request from database.


We can avoid this issue if we use .hta instead of .html.

Dec 11, 2013

Excel VBA: Clipboard clear

This year I started to work into a big company. Here I need to code in MS EXcel VBA. Or VBA Access.

Trying to copy the data from a Excel Sheet to another Sheet, I started to use VBA Clipboard. But, at the end, the clipboard has remained full. The solution  was following:

Clipboard clear 

If you want to cleanup the clipboard of an Excel using VBA, this is the way:
Application.CutCopyMode = False