Hello,
I have created a user form with 3 combo boxes and a DTPicker. The combo boxes allow me to select Name, Day and Price. Whichever day is selected determines which worksheet the data is stored on i.e. Tuesday goes to Tuesday Worksheet, etc.
My problem is with the second user form, which has a combo box and 2 text boxes. This form is to create a report of the data either by day or all days. The combo box is to select the day, while the text boxes are to allow me to pick a date range if required.
Selecting a single day is easy enough. Where I run into problems is when I select "All" for all days then try to specify dates. For example if I pick Wednesday with a start date, then I want all data after that date, providing there is no finish date entered. Like wise, if no start data is entered and an end date is, then I need all the data before the end date. Additionally, you could have start and end date set, then you only need the data between the two.
I am having problems getting the code to search for the date fields and then provide me with the data based on any off the 3 possibilities when using the dates. Can anyone suggest the correct way to check for these conditions?
I have created a user form with 3 combo boxes and a DTPicker. The combo boxes allow me to select Name, Day and Price. Whichever day is selected determines which worksheet the data is stored on i.e. Tuesday goes to Tuesday Worksheet, etc.
My problem is with the second user form, which has a combo box and 2 text boxes. This form is to create a report of the data either by day or all days. The combo box is to select the day, while the text boxes are to allow me to pick a date range if required.
Selecting a single day is easy enough. Where I run into problems is when I select "All" for all days then try to specify dates. For example if I pick Wednesday with a start date, then I want all data after that date, providing there is no finish date entered. Like wise, if no start data is entered and an end date is, then I need all the data before the end date. Additionally, you could have start and end date set, then you only need the data between the two.
I am having problems getting the code to search for the date fields and then provide me with the data based on any off the 3 possibilities when using the dates. Can anyone suggest the correct way to check for these conditions?