I'm trying to open a form in Access via a batch file made in Excel. The batch file needs to pass three parameters to access to load the correct record of the form.
My Batch File looks like the:
Code:
Set /A Project_Request=1
Set /A Project_Release=2
if exist ""C:\Program Files (x86)\Microsoft Office\root\Office16\MSACCESS.EXE"" (
"K:\R&D Dept\Development Lab\R&D Test Request System (For testing and training)\DataBase\R&D Project Requests DB.accdb" /x mcrEmail /cmd 1616
goto install
) else if exist ""C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE"" (
"K:\R&D Dept\Development Lab\R&D Test Request System (For testing and training)\DataBase\R&D Project Requests DB.accdb" /x mcrEmail /cmd 1616
goto install
)
Project: 1616 R1 R2
Batch File To Start Access and open to the submitted request record.
The Function in Access looks like this:
Code:
Public Function fOpenEmailForm()
Dim CounterFieldNumb As Integer
Dim Project_Request As Integer
Dim Project_Release As Integer
CounterFieldNumb = CLng(Command())
Project_Request = 1
Project_Release = 2
Call modCode.SetBypass(False, c_Main_Drive & c_Main_Folder & c_Main_Database_Folder & c_DBName) 'True setting allows bypass of startup options
DoCmd.OpenForm "frmTestRequests", , , "[Counter]=" & CounterFieldNumb And "[Project_Request]=" & Project_Request And "[Project_Release]=" & Project_Release
End Function
This creates an error saying Type Mismatch.
I hard coded the Request and Release, what I need to do is send all three parameters to the access function to open the correct record.
The Fields are Counter, Project_Request, and Project_Release
I'm not sure how to use all three in a batch file and have the correct record load.
Thanks,
Jeff