Repeat the data from previous records

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mathanraj76
    New Member
    • Oct 2007
    • 1

    Repeat the data from previous records

    I current doing a project for "CWS" invoices for data entry in ms access 2000
    I have a diffulcuties in the textbox.

    for an exampe :
    In one invoices may have up to 4 customer .But in 1 invoice the route and date are same and rest is are not same ..

    So i have create textboxes to entry all the data in ..
    what i want if the date and route is same i dont want to key in the same data where the textbox should retrieve the data automaticaly only for date and route textbox

    can u help me how to do this?
    I have been try so many sites but still did not get what i need!

    thanks
    M raj
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by mathanraj76
    I current doing a project for "CWS" invoices for data entry in ms access 2000
    I have a diffulcuties in the textbox.

    for an exampe :
    In one invoices may have up to 4 customer .But in 1 invoice the route and date are same and rest is are not same ..

    So i have create textboxes to entry all the data in ..
    what i want if the date and route is same i dont want to key in the same data where the textbox should retrieve the data automaticaly only for date and route textbox

    can u help me how to do this?
    I have been try so many sites but still did not get what i need!

    thanks
    M raj
    Just a little clarification M raj.
    1. You are entering a New Record.
    2. If the Date and Route are the same as the previously entered Record.
    3. Duplicate some Field values on the Form from the prior Record.
    4. If all this is true, then:
      1. What is your Table Name (Record Source for the Form)?
      2. What are the Text Field Names for the Route and Date Fields?
      3. What Fields need to contain the same information from the previous Record, give Route and Date are the same?

    Comment

    • AaronMor
      New Member
      • Nov 2007
      • 1

      #3
      Originally posted by ADezii
      Just a little clarification M raj.
      1. You are entering a New Record.
      2. If the Date and Route are the same as the previously entered Record.
      3. Duplicate some Field values on the Form from the prior Record.
      4. If all this is true, then:
        1. What is your Table Name (Record Source for the Form)?
        2. What are the Text Field Names for the Route and Date Fields?
        3. What Fields need to contain the same information from the previous Record, give Route and Date are the same?
      I am trying to do the exact same thing that you have both descriibed here. Can anyone please explain how to accomplish this? Thanks

      Aaron

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        You can do this by using the AfterUpdate event of the controls in question to set the Default Value for those fields. The exact code varies depending on the data type of the field.

        For Text fields

        [CODE=vb]Private Sub YourTextControl Name_AfterUpdat e()
        If Not IsNull(Me.YourT extControlName. Value) Then
        YourTextControl Name.DefaultVal ue = """" & Me.YourTextCont rolName.Value & """"
        End If
        End Sub
        [/CODE]
        For Numeric fields


        [CODE=vb] Private Sub YourNumericCont rolName_AfterUp date()
        If Not IsNull(Me.YourN umericControlNa me.Value) Then
        YourNumericCont rolName.Default Value = Me.YourNumericC ontrolName.Valu e
        End If
        End Sub[/CODE]

        For Date fields

        [CODE=vb] Private Sub YourDateControl Name_AfterUpdat e()
        If Not IsNull(Me.YourD ateControlName. Value) Then
        YourDateControl Name.DefaultVal ue ="#" & Me.YourDateCont rolName & "#"
        End If
        End Sub[/CODE]

        Welcome to TheScripts!

        Linq ;0)>

        Comment

        • ahalf0rd
          New Member
          • Feb 2008
          • 2

          #5
          Originally posted by missinglinq
          You can do this by using the AfterUpdate event of the controls in question to set the Default Value for those fields. The exact code varies depending on the data type of the field.

          For Text fields

          [CODE=vb]Private Sub YourTextControl Name_AfterUpdat e()
          If Not IsNull(Me.YourT extControlName. Value) Then
          YourTextControl Name.DefaultVal ue = """" & Me.YourTextCont rolName.Value & """"
          End If
          End Sub
          [/CODE]
          For Numeric fields


          [CODE=vb] Private Sub YourNumericCont rolName_AfterUp date()
          If Not IsNull(Me.YourN umericControlNa me.Value) Then
          YourNumericCont rolName.Default Value = Me.YourNumericC ontrolName.Valu e
          End If
          End Sub[/CODE]

          For Date fields

          [CODE=vb] Private Sub YourDateControl Name_AfterUpdat e()
          If Not IsNull(Me.YourD ateControlName. Value) Then
          YourDateControl Name.DefaultVal ue ="#" & Me.YourDateCont rolName & "#"
          End If
          End Sub[/CODE]

          Welcome to TheScripts!

          Linq ;0)>
          Hi Linq

          I am having problems deciphering which bits of your code need my personal database details and which are just code. Could you please be a little more specific about which bits of the code need my details.

          cheers

          Andy

          Comment

          Working...