VBA for boolean after update (1 Viewer)

RachelC

New member
Local time
Yesterday, 22:35
Joined
Jun 25, 2013
Messages
2
[FONT=&quot]So I’m posting this in VBA because I’m just assuming it’s the only way to make this function happen, if at all (please be advised I’m a newb and forgive me if I am mistaken). I’ve gotten by with macros thus far so I’m not so savvy with VBA yet.[/FONT]
[FONT=&quot]
[/FONT]
[FONT=&quot]The situation is fleet management; Many vendors with many vehicles. The active vendors have active and inactive vehicles. Currently, inactive vendors still have both active and inactive vehicles (this is what I want to eliminate from happening in the future). What I would like to happen is when the “Vendor Is Active” bool is set to false, all vehicles related to the vendor change to inactive (false) as well. I realize I could do this manually for each vehicle first but it seems that didn’t work well in the past for the end user and I would like to make this as simple as possible for them.[/FONT]
[FONT=&quot]
[/FONT]
[FONT=&quot]The structure is: Vendor table, vehicle table (joined by VendorID), A form to edit the vendors (based on an active vendor query; inactive vendors are on a different form). A combo box filters the vendors and a button will bring up the vehicles form displaying vehicles for that vendor. [/FONT]
[FONT=&quot]Any help or suggestions would be greatly appreciated! [/FONT]
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:35
Joined
Aug 30, 2003
Messages
36,129
You can probably stick with a macro if you want (I don't use them, but you may want to stick with what you're comfortable with). The most efficient way to change all of them is probably an update query with a criteria pointing to the form. You can create that query and then run it from a macro.
 

RachelC

New member
Local time
Yesterday, 22:35
Joined
Jun 25, 2013
Messages
2
Thanks Paul! The update query worked great to update the data. I had to muck around a bit to get the macro to run right but it's working good now!
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:35
Joined
Aug 30, 2003
Messages
36,129
Happy to help, and welcome to the site by the way!
 

Users who are viewing this thread

Top Bottom