I would like to run an append query but only after I have checked a table for existing data. I want to see if a ralicarID exists in a table and if it doesnt the query should run. if the railcarid does exist but also has a check in and check out date then the query can also run.
I am not very good at programming but I was thinking something like this
Dim RailcarInDatabase as number
' run query here that checks for the railcar id and returns a value
if railcarID in table then RailcarInDatabase =1 else RailcarInDatabase =0
And if If RailcarID in table and DateInShop is not null and DateOutShop is not null then RailcarInShop = 0
Something like that which will allow me to run the query only if the car is not in the database or it is currently not in the shop.
Any help is appreciated.