Auto Populate

  • Thread starter Thread starter Don Sealer
  • Start date Start date
D

Don Sealer

I could use some help with ms access. I'm really not very proficient with
access and don't understand too much. I have never had any classes and what
I've learned has been trail and error and also with Northwind. Here's where
I'm stuck.
I have a pretty simple database that is going to be used to track defects by
product, machine, employee, type, etc. I have several tables but one shows
all tables and has a fair amount of lookups in it. I also have some
queiries and a single form. What I'd like to do in the form is click on the
field "product" and when I do I'd like to have the cost of this product auto
populate the "cost" field.
I'm not sure if my description is clear or not. If you think you can help
me but need a better description of what I'm trying to do please let me
know.
Thanks,
Don.......
 
Don

If your "product" control on your form is a combo box, you could use the
AfterUpdate event to add in a simple expression that sets the value of
another control (i.e., "cost").

First, make sure that the row source of the "product" combo box includes an
associated cost. Note which column that "cost" is in.

Create a Subroutine in your cboProduct's AfterUpdate event that looks
something like:

Me!txtCost = Me!cboProduct.Column(n)

where "n" is one less than the column you noted above (the Column() property
uses zero-based numbering, i.e., "0, 1, 2, ..."). See Access HELP on Column
for more info.
 
Back
Top