A
alex
Passing Arguments
Hello,
I’ve created a sub to delete and open tables. It looks like this:
‘’’’’’’’’’’’’’’
Sub OpenCloseTable(strTableName As String)
DoCmd.Close acTable, strTableName
DoCmd.OpenTable (strTableName)
End Sub
‘’’’’’’’’’’’’’’’
With the code, however, I have to close and open the same table. I’d
like to do something like this:
‘’’’’’’’’’’’’’’‘
Sub OpenCloseTable(strOpenTable As String, strCloseTable as String)
DoCmd.Close acTable, strCloseTable
DoCmd.OpenTable (strOpenTable)
End Sub
‘’’’’’’’’’’’’’’’’
With the latter code, however, I may not always close and/or open a
table; i.e., I need to pass only one argument. Something like this:
‘’’’’’’’’’’’’’’’’
Call OpenCloseTable(“MyTable”,) ‘open table
Call OpenCloseTable(,”MyTable”) ‘close table
‘’’’’’’’’’’’’’’’’
Is this possible?
Thanks,
alex
Hello,
I’ve created a sub to delete and open tables. It looks like this:
‘’’’’’’’’’’’’’’
Sub OpenCloseTable(strTableName As String)
DoCmd.Close acTable, strTableName
DoCmd.OpenTable (strTableName)
End Sub
‘’’’’’’’’’’’’’’’
With the code, however, I have to close and open the same table. I’d
like to do something like this:
‘’’’’’’’’’’’’’’‘
Sub OpenCloseTable(strOpenTable As String, strCloseTable as String)
DoCmd.Close acTable, strCloseTable
DoCmd.OpenTable (strOpenTable)
End Sub
‘’’’’’’’’’’’’’’’’
With the latter code, however, I may not always close and/or open a
table; i.e., I need to pass only one argument. Something like this:
‘’’’’’’’’’’’’’’’’
Call OpenCloseTable(“MyTable”,) ‘open table
Call OpenCloseTable(,”MyTable”) ‘close table
‘’’’’’’’’’’’’’’’’
Is this possible?
Thanks,
alex