Text field propegation (Access 2007)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MOCaseA
    New Member
    • Aug 2010
    • 34

    #1

    Text field propegation (Access 2007)

    OK I have a problem. I'm fairly sure this has been answered somewhere, but ai can't seem to find it.

    I have a single table with 3 fields:

    Table1:
    empFirstName
    empLastName
    empFullName

    In a separate Access "DB" I have a form that allows me to create, edit and delete entries on this table. The form has these three text fields:

    Form1:
    frmFirstName
    frmLastName
    frmFullName

    What I am trying to do is get the frmFullName text field to auto-propegate from the frmFirstName and frmLastName fields when creating a new record. Along with that auto-propegation I need the resulting information to fill in the empFullName collumn on the linked table. I use the empFullName field on other tables and forms as a standardization technique, but for the life of me I can't figure out how to do this. I can follow the guides and get the text field to show the full name, but that requires filling specific info into the control source, which then stops the information from being saved to the table. I'm stuck and would appreciate any help.

    When I enter the following line in the Control Source property box if shows up correctly on the form, but does not fill in the field on the table.
    Code:
    =[LastName] & ", " & [FirstName]
    Example:

    First Name: Test
    Last Name: Bug
    Full Name: Bug, Test

    Getting the Full Name to fill to the Table1 empFullName field is where I am having my issues.
  • Mariostg
    Contributor
    • Sep 2010
    • 332

    #2
    I suppose the problem is that you source your fullName field by concatenating two other fields, which does not tell your fullName field to source (fill) your empFullName field.
    Maybe you want to implement some actions when either of the First or Last Name fields change
    Code:
    Private Sub firstName_AfterUpdate()
        UpdateFullName
    End Sub
    Private Sub lastName_AfterUpdate()
        UpdateFullName
    End Sub
    Function UpdateFullName()
        Me.FullName = Me.lastNAme & ", " & Me.firstName
    End Function

    Comment

    • MOCaseA
      New Member
      • Aug 2010
      • 34

      #3
      Absolutely beautiful. The perfect... I knew I was missing something... Thank you!

      Comment

      Working...