Hi everyone,

I am new to VBA and really appreciate all the tips, tricks and fixes that have been posted on this site. However, I have developed a problem to which I can't find a solution and was hoping that someone might be able to help me out.

I am working on a database of surgical records. Each row represents one surgery. There are 25 columns which contain basic demographic information including date of birth, gender and date or surgery. I have designed a userform that searches this database with a number of steps all which occur simultaneously when the "search" button is pressed.

1. user selects the Gender from option buttons (VBA: autofilters the database accordingly)

2. User puts in the range of Operating Room dates and Date of Birth which they would like to see - eg: OR dates from 01-02-2005 to:04-06-2012 and DOB from 1-1-1950 to 1-1-2000 (VBA: autofilters the database)

3. User has option of inputting 4 keywords, 2 are comboboxes which contain a list of surgeries, and 2 are normal textboxes (VBA: Uses .Find to locate any entries within the newly filtered range that match the keywords listed)

4. any rows that fit the criteria get copied and pasted into a new sheet called "search results"

The userform functions perfectly as long as the DATE boxes (outlined in step 2 above) contain values. As soon as these boxes are blank I try and search I get a Run-time error 13: type mismatch. I would like to be able to use the userform without having to always input dates (as the user will not always need to specify the OR dates and DOB). I was wondering whether there was a way that the userform can "disregard" the date boxes if they have been left empty?

Thanks for any help you can provide. Let me know if you require clarification. I would prefer not to post a dummy copy of the workbook but can if it is needed.

Thanks alot!