After Update Event Procedure

  • 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!
 
In the code associated with a form, Me! refers to the active form.
Therefore, Me!ShipName refers to a control named ShipName on the current
form.

Me![CustomerID].column(1) refers to the value in the second column of the
selected row on the CustomerID form on the current form (the columns start
at 0)
 
Hi,
Thanks so much for your response. It makes sense and clears things up!.

I have another question, though. Why only refer to the Customer ID, column
1 in the first line only?

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

Thanks so much!
--
Thanks!

Dee


Douglas J. Steele said:
In the code associated with a form, Me! refers to the active form.
Therefore, Me!ShipName refers to a control named ShipName on the current
form.

Me![CustomerID].column(1) refers to the value in the second column of the
selected row on the CustomerID form on the current form (the columns start
at 0)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



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!
 
Obviously only one control needs to get its value from the combobox. If
there were other columns in the combobox that you wanted to transfer to
other controls, you might have

Me!SomethingElse = Me![CustomerID].column(2)
Me!AnotherValue = Me![CustomerID].column(3)



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



dee said:
Hi,
Thanks so much for your response. It makes sense and clears things up!.

I have another question, though. Why only refer to the Customer ID,
column
1 in the first line only?

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

Thanks so much!
--
Thanks!

Dee


Douglas J. Steele said:
In the code associated with a form, Me! refers to the active form.
Therefore, Me!ShipName refers to a control named ShipName on the current
form.

Me![CustomerID].column(1) refers to the value in the second column of the
selected row on the CustomerID form on the current form (the columns
start
at 0)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



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!
 
Thank you for your response.

Yes, this would mean in my example that the Ship To: Company Name is the
same as the CustomerID combo box column 1, correct?

As a related question, why is this followed by:
Me!ShipAddress = Me!Address
Me!ShipCity = Me!City

etc.

I know that the field names are ShipAddress, ShipCity, etc., so can sort of
understand their reference in the left side of the statements, but why, for
example, just "Me!Address" in the right side of the statement.

I see that these controls are filled in automatically based on the customer
selected, but don't understand in plain English what these statements
specifically mean.

Any help would be appreciated in clarifying this.

--
Thanks!

Dee


Douglas J. Steele said:
Obviously only one control needs to get its value from the combobox. If
there were other columns in the combobox that you wanted to transfer to
other controls, you might have

Me!SomethingElse = Me![CustomerID].column(2)
Me!AnotherValue = Me![CustomerID].column(3)



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



dee said:
Hi,
Thanks so much for your response. It makes sense and clears things up!.

I have another question, though. Why only refer to the Customer ID,
column
1 in the first line only?

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

Thanks so much!
--
Thanks!

Dee


Douglas J. Steele said:
In the code associated with a form, Me! refers to the active form.
Therefore, Me!ShipName refers to a control named ShipName on the current
form.

Me![CustomerID].column(1) refers to the value in the second column of the
selected row on the CustomerID form on the current form (the columns
start
at 0)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



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!
 
There are either controls on the form named Address and City, or else those
are fields in the underlying record source for the form.

Since I can't see your form, I can only guess. Do you have a place for the
customer name and address, and another place for the Ship To name and
address? Does the Ship To name and address get prefilled with the customer
name and address, but you can change that if you want? That's certainly what
it sounds like to me, so the code you're citing is how it prefills the Ship
To stuff.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



dee said:
Thank you for your response.

Yes, this would mean in my example that the Ship To: Company Name is the
same as the CustomerID combo box column 1, correct?

As a related question, why is this followed by:
Me!ShipAddress = Me!Address
Me!ShipCity = Me!City

etc.

I know that the field names are ShipAddress, ShipCity, etc., so can sort
of
understand their reference in the left side of the statements, but why,
for
example, just "Me!Address" in the right side of the statement.

I see that these controls are filled in automatically based on the
customer
selected, but don't understand in plain English what these statements
specifically mean.

Any help would be appreciated in clarifying this.

--
Thanks!

Dee


Douglas J. Steele said:
Obviously only one control needs to get its value from the combobox. If
there were other columns in the combobox that you wanted to transfer to
other controls, you might have

Me!SomethingElse = Me![CustomerID].column(2)
Me!AnotherValue = Me![CustomerID].column(3)



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



dee said:
Hi,
Thanks so much for your response. It makes sense and clears things
up!.

I have another question, though. Why only refer to the Customer ID,
column
1 in the first line only?

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

Thanks so much!
--
Thanks!

Dee


:

In the code associated with a form, Me! refers to the active form.
Therefore, Me!ShipName refers to a control named ShipName on the
current
form.

Me![CustomerID].column(1) refers to the value in the second column of
the
selected row on the CustomerID form on the current form (the columns
start
at 0)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



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