Linking field to combo box column

G

Guest

I am trying to figure out how to activate subsequent fields only when "other"
is chosen from my combo box titled "Vendor Name". This way when a new vendor
is used by an employee they will be guided to add the vendor's info (phone#,
website etc). For stored vendors, when chosen from the combo box, this info
automatically comes up in a read-only subform, but I need a way to report new
vendors without changing my subform from its current read-only format.
 
G

Guest

I'm not exactly sure what you are asking for. When you say "read only" on
your subform, how are you controlling that and where do you launch the
subform?
Typically, when you want to take an action based on a value in a a combo
box, you put the code in the after update event of the combo box. So if your
sub form properties are set for like
allow edits = no
allow deletions = no
allow deletions = no

Then in the After update event:

Me.AllowAddions = Me.VendorName = "Other"

If Other is chosen you can add a new record. If anything else is selected,
you can't. You can add additional properties as needed using this concept.
 
L

Larry Daugherty

This sounds like just what the NotInList event handles so well.
You'll find a good example at www.mvps.org/access Search for
NotInList. Dev's example doesn't de everything you'd like ... In the
"add it" side, save the PK of the new value you just added in a
variable so that you can add some code to open the form you already
use to enter vendors. Enter all of the vendor info before returning
to your original task.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top