I want to pass a string aPath contains path of the active workbook to access vba module or sub. Below is my excel vba code that will open access db form. How do i pass the string value to access vba.
Code:
[/SIZE]
[SIZE=2] Dim aPath, aDbase, aDSource, aTable, exePath As String[/SIZE][SIZE=2] [/SIZE]
[SIZE=2] Dim fileParam As String[/SIZE]
[SIZE=2] aPath [/SIZE][SIZE=2]= ActiveWorkbook.[/SIZE][SIZE=2]Path [/SIZE]
[SIZE=2] aDbase = "near_14.accdb"[/SIZE]
[SIZE=2] aDSource [/SIZE][SIZE=2]= aPath & "\" &[/SIZE][SIZE=2] aDbase[/SIZE]
[SIZE=2] Set appAccess = CreateObject("Access.Application")[/SIZE]
[SIZE=2] appAccess[/SIZE][SIZE=2].Visible = True[/SIZE]
[SIZE=2] appAccess[/SIZE][SIZE=2].[/SIZE][SIZE=2]OpenCurrentDatabase aDSource[/SIZE]
[SIZE=2] appAccess.DoCmd.OpenForm "Import_From_P"[/SIZE]
[SIZE=2] appAccess[/SIZE][SIZE=2].CloseCurrentDatabase[/SIZE]