"on form (on table)" ... I don't understand.
One way to get a textbox control (e.g., txtDescription) to fill in with the
value that corresponds to a selection made in a combobox would be to use
more than one field in the combobox. Then, in the AfterUpdate event for the
combobox, the value of txtDescription is set to the value of the selected
record's (n-1) column.
For example, if you had a combobox that held a recordID and a concatenated
[FirstName] & " " & [LastName], and a [HomeTown], you could first be storing
the recordID but displaying the concatenated name. If you also wanted to
see the [HomeTown] added to the txtDescription control, you could use
something like:
Me!txtDescription = Me!cboYourComboboxName.Column(2)
in the combobox's AfterUpdate event.
Good luck!
Regards
Jeff Boyce
Microsoft Office/Access MVP
Jupe said:
Item Code (Itemcode) and Description (TransDesc) On form (on table)
Jeff Boyce said:
What are the names of the controls on your form that are affected (i.e.,
the
combobox and the textbox)?
Regards
Jeff Boyce
Microsoft Office/Access MVP
Jupe said:
This is actually the event procedure:
'Fill-in transaction description using the ItemCode's description
Private Sub ItemCode_AfterUpdate()
mstrItemCode = Me.ItemCode.Value
Me.Description.Value = DLookup("[ItemDesc]", "InventoryItems",
"[ItemCode]
=
mstrItemCode")
End Sub
:
I appreciate your help Jeff - unfortunately there is nothing there and
the
compile found nothing. I guess I was hoping there was a quick fix and
that
this was a common problem because I do not really know how to program
in
access
:
Open the form in design view. Check the AfterUpdate event procedure
'behind' the combobox. Try running the Compile to see if Access can
find
all the necessary references/parts.
Regards
Jeff Boyce
Microsoft Office/Access MVP
I have a database that was designed in Access 2003 (not by me) and
is
now
in
2007. We have a Purchase Order form that we fill in the item code
(from a
combo box) and it automatically filled in the description box. As
soon as
we
went to 2007 it no longer does this. Any ideas?