After Update Event

D

dee

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!
 
W

Wayne Morgan

"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.
 
D

dee

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!
 

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

After Update Event Procedure 5
Data Entry VBA 4
Data entry VBA 1
Data entry to table from a form 0
Absolute Field Validation 24
Error '3163' 1
combo box question 3
After Update Fill 3

Top