Hello, I am working on my first database with Access and am new to VBA. Until now I have been able to make most of my items work with Macros. I am now running into a point where I try to make a button do a large amount of work and Macros just wont cut it.
The database I am working on is to keep track of employees and the devices they are assigned (Laptop, Phone, Fax#, and Mifi). When an employee is terminated I need to set the device status from In-Use to Waiting On Return. I created a pseudo code of what I am trying to do and put it below. I need to search the tables and find matching records and edit the data. It is possible that the employee might have more than one of each device assigned (ex: two Laptops).
TL
R - I need to search 4 tables for matching records and edit data in them. I have created a pseudo code of what i'm trying to do but I don't know VBA enough to implement it properly. I may be able to use queries but unsure how.
Thank you to anyone who helps. I greatly appreciate it as I have searched all over with no luck.
The database I am working on is to keep track of employees and the devices they are assigned (Laptop, Phone, Fax#, and Mifi). When an employee is terminated I need to set the device status from In-Use to Waiting On Return. I created a pseudo code of what I am trying to do and put it below. I need to search the tables and find matching records and edit the data. It is possible that the employee might have more than one of each device assigned (ex: two Laptops).
TL

Code:
Search LaptopT{
If ([LaptopOwner_FK] = [tmpContactID]){
Me.[LaptopStatus_FK] = “5”
}
}
Search CellT {
If ([CellOwner_FK] = [tmpContactID]){
Me.[CellStatus_FK] = “5”
}
}
Search MifiT {
If ([MifiOwner_FK] = [tmpContactID]){
Me.[MifiStatus_FK] = “5”
}
}
Search FaxT {
If ([FaxOwner_FK] = [tmpContactID]){
Me.[FaxStatus_FK] = “1”
Me.[FaxOwner_FK] = “(Number for Open Fax)”
Me.[FaxADUsername_FK] = “(Number for Open Fax Username)”
Me.[FaxDepartment_FK] = “”
Me.[FaxUsername] = “”
Me.[FaxPassword] = “”
CreateNewRecord in DeviceHistoryT (“”,””,””,””,[tmpContactID], “”, Date(), [FaxNumber])
}
}
Thank you to anyone who helps. I greatly appreciate it as I have searched all over with no luck.