Hi everyone.. Can someone help me please? In Access form I have two textboxes (Months From) and (Months To). These two textboxes returns records based on the following query criteria code:
Between [Forms]![frm_JobPlacementInfo]![MonthFrom TextBox] And [Forms]![frm_JobPlacementInfo]![MonthTo TextBox]
So, if for instance I put 3 in the first textbox and 9 in the second textbox, then I will get all records containing the numbers between 3 and 9. This works perfect and great.
My problem is: when I want to keep the two textboxes blank to get all records, the query fails to give all available records because I did not put any number in the textboxes, which means no record matches my criteria.
I adjusted my code to the following:
Between [Forms]![frm_JobPlacementInfo]![MonthFrom TextBox] And [Forms]![frm_JobPlacementInfo]![MonthTo TextBox] Or Like [Forms]![frm_JobPlacementInfo]![MonthFrom TextBox] & "*"
This code solves the previous problem, but I got a new problem. When I put the numbers 3 and 9 in the textboxes, I am not getting only records have numbers between 3 and 9 only but also records have numbers like 13, 30, 33, 19, 90, or 99.
I got confused and don’t know how to solve this new problem. Is there any suggestion please?
Thank you so m much.