I previously developed in Access and have recently decided to move over to SQL server back-end and vb2008 front-end.
My Everest of problems which I can’t solve is the how to filter records by a user selected parameter. However, if the parameter is null then all records should be shown.
In Access I could do this quit easily within a query, based on table TblOffice, by using
(((TblOffice.Site)=[Forms]![Main Menu]![CmbSite])) OR ((([Forms]![Main Menu]![CmbSite]) Is Null))
Currently, as before, I have my combo box ‘CmbSite’ on my form ‘MainMenu’, and a table named TblOffice that contains a field ‘Site’
As all records, that’ll be accesses from various forms within the application, will be based on this filter it’s best to have the records filtered at the server side rather then dragging everything down to a typed dataset.
Am I right in thinking this filter should be held as an SQL View which subsequent tables in datasets are related to?
I’m not sure if SQL allows pointing directly to an object on a form, so the biggy for me is what’s the equivalent code to (((TblOffice.Site)=[Forms]![Main Menu]![CmbSite])) OR ((([Forms]![Main Menu]![CmbSite]) Is Null)) a small step by small step idiot proof guide would be the icing on the cake for me.
I realise that maybe I’m asking for a little too much here but any thoughtfull pointers to the right direction would also be great start.