VBA Subroutines / Functions optional input parameters

  • Thread starter Thread starter JDB
  • Start date Start date
J

JDB

Is it possible to have multiple optional arguments in a subroutine or
function?

I use access as the front end for some optimization software, and I
need to create multiple tables on the fly based on the criteria i
select from list boxes.

Right now for every table I create I have something like ;

Function addRecord(rstWrite As ADODB.Recordset, strUPC, _
strHour, strRouting, strDumpers, _
strLabelers, strCasers, strUPC_10)


With rstWrite
.AddNew
!idxUPC = strUPC
!idxHour = strHour
!idxRouting = strRouting
!idxDumpers = strDumpers
!idxlabelers = strLabelers
!idxCasers = strCasers
!UPC_10 = strUPC_10

.Update

End With

End Function

I would like to use this AddRecord function to develop different
tables with a different number arguments.

Thanks

JDB
 
Back
Top