Combo box to fill data into form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form "FRMBol". When the user enters the consignee's name I would
like the delivery address to fill automatically. Most of form comes from
table "TBLSalesOrderTotals". In "TBLSalesOrderTotal" I have fields
"Consignee" and "DelLoc1" and "DelLoc2". I also have these field names in a
table "TBLConsignee" which contains the names and addresses. In
"TBLSalesOrderTotal" I set the field "Consignee" as a Combo Box and "DelLoc1"
and "DelLoc2" as text boxes. The source in the settings for the Combo Box is
in the table "TBLConsignee". After that I start to get lost. I realize that
I have to use the After_Update event but I don't understand how and where?
If you could please be as specific as possible. At this point I am getting
so frustrated with Access that I just want to get this job done. Thank you.
Thank you. Thank you.
 
hi,
here is a sub i use to fill in the description text box
once i enter the item number in the item text box. you can
just change my field names and table names to your's.

Private Sub txtItemID_BeforeUpdate(Cancel As Integer)
Dim txtItemID As Variant
If IsNull(Me!txtItemID) Then
Cancel = True
Else
Me!txtDescription = DLookup
("[ItemName]", "IMA", "[ItemID] ='" & Me!txtItemID & "'")
End If
End Sub
 
Hi Peter,

Have the query on which your combobox is based also return the fields
DelLoc1 and DelLoc2. Be sure to set the number of columns to 3. In the
After_Update event of the combobox put the lines

me!DelLoc1 = mc!cboConsignee.column(1)
me!DelLoc2 = me!cboConsignee.column(2)

The assumes that the bound column is column1 and that it contains the field
Consignee.

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

Similar Threads

how? 8
names and addresses 1
how to 4
Consignee and contact 3
Relationship using the same field 1
drop-down menu in a Page 1
Validation in Field Lists 1
Auto fill-in 1

Back
Top