I have a form that fills out a table. In this for there are fields like part description, part number, etc. All of the fields i'm working with in my form are combo boxes. I building a library of gages that our company owns that it lends out to employees to do a job. The two fields i'm working with is Item location and item status. Item location is where the gage is currently located (ie. the department that borrowed the item). The status field tells me whether the item is in stock or has been borrowed. What i want to do is when someone returns an item and selects to change the item status to "Checked In" it automatically changes the field "department" to "QC Lab" or which is where we store all the gages. I have tried many things including if statements like this:
IIf([Gagelist].[GageStatus]="Checked In","Qc Lab")
I tried putting this in a query and in a button control but still get no good result. I still very new at this so i'm sure it can be done but i don't know the best place to do this much less the correct statement. Any help you can give will be greatly appreciated.
The IIf function has a condition, true part, and false part. The statements you listed are both missing the false part, but the first one is the closest to being valid. Following would probably be better:
What i tried to do is edit the macro for the button, "Save and New" to complete this task before it saves the record and goes to a new one but i get an error "This object doesnt contain automation object 'GageList.' Is this possible or should i do this in a different location, query etc.