Using the value from a cell in a continuous form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramprat
    New Member
    • Oct 2008
    • 60

    Using the value from a cell in a continuous form

    Hi,

    Using Access 2003 how do you read the value from a particular cell (row/column combination) in the current record of a continuous form and use this value elsewhere? For example, how do you capture what is in column 2 of the current record of a continuous form? This sounds like it should be simple but maybe I am.

    Thanks
  • RuralGuy
    Recognized Expert Contributor
    • Oct 2006
    • 375

    #2
    That "column" is displayed in a control that has a name that you can reference.

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      You really need to get out of you "Excel" state of m ind. In Access the "columns" are, as Allan has said, textbox controls that hold fields, each of which has its own name. The "rows" represent records.

      If the name of the 2nd column was, for instance, LastName, then to refer to this control, on the Current Record, in code in that form you'd use

      Me.LastName.Val ue

      Because .Value is the Default Property for a Textbox control, you can shorten referral to it to simply

      Me.LastName

      Exactly how/where are you trying to use the value?

      Linq ;0)>

      Comment

      • ramprat
        New Member
        • Oct 2008
        • 60

        #4
        Originally posted by missinglinq
        You really need to get out of you "Excel" state of m ind. In Access the "columns" are, as Allan has said, textbox controls that hold fields, each of which has its own name. The "rows" represent records.

        If the name of the 2nd column was, for instance, LastName, then to refer to this control, on the Current Record, in code in that form you'd use

        Me.LastName.Val ue

        Because .Value is the Default Property for a Textbox control, you can shorten referral to it to simply

        Me.LastName

        Exactly how/where are you trying to use the value?

        Linq ;0)>
        Linq,

        Thanks. What I am trying to do is to update a timestamp field (a field in the underlying table of my continous form) with the current date when a record is changed on my continuous form. I only want to update the timestamp field for that particular record that is changed and not for all the records in the table whcih is what seems to ahppen when I work with continuous forms.

        Thanks

        Comment

        • missinglinq
          Recognized Expert Specialist
          • Nov 2006
          • 3533

          #5
          That's simple enough to do, something like:

          For Date & Time
          Code:
          Private Sub Form_BeforeUpdate(Cancel As Integer)
            Me.TimeStampFieldName = Now
          End Sub
          For just Date
          Code:
          Private Sub Form_BeforeUpdate(Cancel As Integer)
           Me.TimeStampFieldName = Date
          End Sub
          When you say your current efforts are changing the timestamp for all records, do you mean it does this in the table, or that the field shows the same timestamp for all records on the continuous form? When changing data in one textbox on a continuous/datasheet form changes the data in that textbox on all records, it indicates that the textbox is not actually bound to a field in the underlying table/query.

          Linq

          Comment

          • ramprat
            New Member
            • Oct 2008
            • 60

            #6
            Thank you Linq! Problem solved. I appreciate all your help!

            Ramprat

            Comment

            Working...