Hi,
I am fairly new to VBA and have been working on an Access database for my company to keep track of all employee holiday.
On my form I have the security name/level (which is just their username and their admin privileges). I have a button that I use on the main form to open a report. On this button I am trying to open the report using a technique that says for example:
If Me.Text21 = "LOGGED IN USERNAME" then
DoCmd.OpenReport "rptApprovedHol", acViewPreview, WhereCondition-: EmpName = "LOGGED IN USERNAME"
I probably need to be looking at the table, but i'm unsure of how to string it all together.
I want the report to open and depending on the logged in user, filter to their holiday records.
Holiday records are kept in a table called "tblApprovedHol" and the field that I think needs to filter the report would be the "EmpName" in this table.
I basically want the button to open the report, filter the report by user, by looking at the logged in user and comparing it to the records in the approved holiday table.
Anyone able to send some guidance for a very confused person? :D
Thank you kindly!
Bookmarks