If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
populating field
Hello,
i would like to be able to automatically populate a field in a table from a form the fields are as follow: FirstName LastName i am able to concatenate the field in the form but i'm not sure how to submit my result to the table. the formula in the e-mail field in the form is [FirstName] & "."& [LastName] & " how do i submit this to the table |
#2
|
|||
|
|||
populating field
On Mon, 2 Nov 2009 19:36:05 -0800, JY
wrote: Well, one could argue that there is no need to store Email in a table, since it is a calculated value, and an important relational design rule says you should not store calculated fields. What if someone changes his or her lastname? Will you not forget to also update the email field? If I did not convince you, you could proceed like this: in both the FirstName_AfterUpdate and the LastName_AfterUpdate event write: Me.myEmailControl = CalculateEmail() Then write a function: private function CalculateEmail() as string CalculateEmail = Nz(Me.myFirstNameControl,"") & "." & Nz(Me.myLastNameControl,"") & " end function -Tom. Microsoft Access MVP Hello, i would like to be able to automatically populate a field in a table from a form the fields are as follow: FirstName LastName i am able to concatenate the field in the form but i'm not sure how to submit my result to the table. the formula in the e-mail field in the form is [FirstName] & "."& [LastName] & " how do i submit this to the table |
#3
|
|||
|
|||
populating field
On Mon, 2 Nov 2009 19:36:05 -0800, JY wrote:
Hello, i would like to be able to automatically populate a field in a table from a form the fields are as follow: FirstName LastName i am able to concatenate the field in the form but i'm not sure how to submit my result to the table. the formula in the e-mail field in the form is [FirstName] & "."& [LastName] & " how do i submit this to the table In addition to the very valid problems Tom mentions, what if you happen to have two employees who happen to have the same first and last name? A good many year ago I once worked with Dr. Lawrence David Wise and his colleague, Dr. Lawrence David Wise. Which one gets their name as their email? -- John W. Vinson [MVP] |
#4
|
|||
|
|||
populating field
Thanks for your response but it doesn't seem to be working. i'm not sure what
i'm doing wrong. i new to Access and creating forms In my form i added Me.myEmailControl = CalculateEmail() in the after update in the [Event Procedure] of FirstName & LastName field. then i added private function CalculateEmail() as string CalculateEmail = Nz(Me.myFirstNameControl,"") & "." & Nz Me.myLastNameControl,"") & " end function when i open my form and enter the firstName and the LastName in those the e-mail field those not populate. i must have mist something. "Tom van Stiphout" wrote: On Mon, 2 Nov 2009 19:36:05 -0800, JY wrote: Well, one could argue that there is no need to store Email in a table, since it is a calculated value, and an important relational design rule says you should not store calculated fields. What if someone changes his or her lastname? Will you not forget to also update the email field? If I did not convince you, you could proceed like this: in both the FirstName_AfterUpdate and the LastName_AfterUpdate event write: Me.myEmailControl = CalculateEmail() Then write a function: private function CalculateEmail() as string CalculateEmail = Nz(Me.myFirstNameControl,"") & "." & Nz(Me.myLastNameControl,"") & " end function -Tom. Microsoft Access MVP Hello, i would like to be able to automatically populate a field in a table from a form the fields are as follow: FirstName LastName i am able to concatenate the field in the form but i'm not sure how to submit my result to the table. the formula in the e-mail field in the form is [FirstName] & "."& [LastName] & " how do i submit this to the table . |
Thread Tools | |
Display Modes | |
|
|