Showing posts with label vb code. Show all posts
Showing posts with label vb code. 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