ta col,
ANy idea why the command button errors at: theId = ctl.Column(0, v)
im trying to select a date in a list box from expr query you gave me have this script below but keeps erroring at the above script.
any ideas what it is.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'The first column in the list, holding SupplierID, is hidden.
'See the list's "Column Widths" and "Column Count" properties in
'its property dialog and look up the terms in Help for more info.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Coordinates: 1st column (0); row v
'where v changes for each round of the loop.
theId = ctl.Column(0, v)
'Tag on to string.
WhereCrit = WhereCrit & theId & " OR Expr2 "
Next v
'Loop ends; selected items are now accounted for...
'NOTE: To better understand what the code is doing, uncomment the
'next line to print the Where string to the Immediate window.
'Debug.Print WhereCrit
'Clean-up the Where string by removing the trailing text.
WhereCrit = Left(WhereCrit, Len(WhereCrit) - 17)
'Test (see note a few lines above).
'Debug.Print WhereCrit
'By default, the Suppliers Report returns all records from the Suppliers Table.
'Here the Suppliers Report is opened using the 'Where clause' to filter it down
'to only the items selected in the listbox.
DoCmd.OpenReport "MD Form", acViewPreview, , WhereCrit
End Sub