Hello,
I am new to access and was wondering about comparing data from a specific table with the entry of a form. For example, First I have a table called Overtime and in that table I have a two fields Staff_Number and Overtime_Date. I use the Staff_Number to associate the Overtime_Date to an employee. Second, I have a form that has a combo box(Input_Staff is the name), text box(Input_Date is the name) and a button(Add_Overtime is the name). If I select the Staff_Number from the combo box(Input_Staff) then input the date of say 8/26/2020 in the textbox(Input_Date) how do I then call the data from the table(Overtime) to compare these values?
For instance the button I have I want to be able to code it so when clicked I can have an if statement like:
Code:
If ((Input_Date) > (Overtime.Overtime_Date)) Then
Do This
Else
Do this
END If
At the same time I would need the statement to also be able to figure out which date to pull for instance if input_date is > overtime.overtime_date where input_staff = staff_number.
I appreciate any assistance given. Thank you.