AutoFill

  • Thread starter Thread starter Brook
  • Start date Start date
B

Brook

I have two tables: tblProgramData (fields DesignNumber and
DesignName) and tblProgramorders(OrderDate, Due Date,
DesignNumber, DesignName, Size, etc). I have a simple form
that has OrderDate, Due Date, DesignName, DesignNumber.

What I am trying to do is this:

On my form, on the field DesignName I would like a combo
box that when drops down gives me both the DesignName and
DesignNumber. When the combo box drops down, I want to
choose the design name, have it fill in this field, and
then automatically fill in the DesignNumber field as well.
I would also like to do the same for the DesignNumber
field.

AnySuggestions?

Brook

Please let me know if you have any questions or don't
understand my question?
or email me at: brook at karmaimports dot net
 
Brook,

Your tblProgramorders table should not contain both the DesignName and
DesignNumber fields. I would remove DesignName entirely from the table.
Then, put a combobox on the ProgramOrders form bound to the
DesignNumber field, and set the tblProgramData table as its Row Source.
Adjust the Properties of the combobox, for example Column Count = 2,
so you can see both the DesignNumber and the DesignName when you drop
down the combobox list. Then, put an unbound textbox on the form to
show the DesignName, and set its Control Source property to
=[DesignNumber].[Column](1)
Another approach would be to base your form on a query which includes
both tables, joined on the DesignNumber field from each, and then you
can include the DesignName field from the tblProgramData table directly
into the query, and hence to the form, and when the DesignNumber
combobox selection is made, the associated DesignName will automatically
be shown. If you do it this way, you should set the Locked property of
the DesignName control to Yes and its Enabled property to No.
 
Back
Top