After Update Event

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

Guest

Hi,

I'm basing a form on the Northwind example. I created a combo box to select
the FamilyID from the TblFamilyInfo.

When the user selects a family name, I wish the other information to be
automatically displayed on the form (such as phone number). I looked at the
code and see:

Me!ShipName = Me![CustomerID].column(1)
Me!ShipAddress = Me!Address
etc.

I would like to use the same idea:
Me!PhoneNumber = Me!, etc.

I have looked in the Help file and can't understand what Me! does. Also,
why the [fieldID].Column(x) on the first line of code?

A quick translation into plain English would be extremely appreciated!
 
"Me!" or "Me." is just shorthand for the form or report that the code is
running on. You could use Forms!FormName also, but it's more typing.

The Column(1) is assigning the value in the second column of the combo box
CustomerID to the textbox or field ShipName. The combo box has more than one
column, the first column is probably the ID field for the customer and is
the bound field for the combo box, which will cause the ID value to be
stored in the Control Source of the combo box. This column is probably
hidden (width = 0) from the user's view. What the user sees is the text
name. The Column() index number is zero based, so 0 is the first column, 1
is the second, 2 is the third, etc.
 
Hi Wayne,

Thanks so much for explaining this so clearly. I have printed your response
and will study it as I work on this later tonight!


--
Thanks!

Dee


Wayne Morgan said:
"Me!" or "Me." is just shorthand for the form or report that the code is
running on. You could use Forms!FormName also, but it's more typing.

The Column(1) is assigning the value in the second column of the combo box
CustomerID to the textbox or field ShipName. The combo box has more than one
column, the first column is probably the ID field for the customer and is
the bound field for the combo box, which will cause the ID value to be
stored in the Control Source of the combo box. This column is probably
hidden (width = 0) from the user's view. What the user sees is the text
name. The Column() index number is zero based, so 0 is the first column, 1
is the second, 2 is the third, etc.

--
Wayne Morgan
MS Access MVP


dee said:
Hi,

I'm basing a form on the Northwind example. I created a combo box to
select
the FamilyID from the TblFamilyInfo.

When the user selects a family name, I wish the other information to be
automatically displayed on the form (such as phone number). I looked at
the
code and see:

Me!ShipName = Me![CustomerID].column(1)
Me!ShipAddress = Me!Address
etc.

I would like to use the same idea:
Me!PhoneNumber = Me!, etc.

I have looked in the Help file and can't understand what Me! does. Also,
why the [fieldID].Column(x) on the first line of code?

A quick translation into plain English would be extremely appreciated!
 
Back
Top