Update from a form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • swhipple
    New Member
    • Feb 2008
    • 2

    Update from a form

    I have a form that pulls in a selected number of records from a table using a parameter query that I enter parameter each time. I want to add a date in a field to all of these records that are in the form using an update query without running through another Update query entering the same parameters. Any help would be appreciated.

    Thanks in advance!
  • jeffstl
    Recognized Expert Contributor
    • Feb 2008
    • 432

    #2
    Um....I THINK i know what you said, but lets see.

    It sounds like you want a date entered into a bunch of records? Like a data entry problem? Except you want to be able to do all the records at once?

    Or are you saying you want to use a date to be your parameter for searching these records?

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32668

      #3
      The OP wants a way of referencing the recordset which is driving the current form.
      As the user will have helped to specify the recordset by entering parameters, this is not simply done by referring to the RecordSource property of the form.

      Try using Me.RecordsetClo ne (or possibly even Me.Recordset). I don't think there's a simple way of getting a SQL string if that's what you're after.

      Comment

      • swhipple
        New Member
        • Feb 2008
        • 2

        #4
        Originally posted by jeffstl
        Um....I THINK i know what you said, but lets see.

        It sounds like you want a date entered into a bunch of records? Like a data entry problem? Except you want to be able to do all the records at once?

        Or are you saying you want to use a date to be your parameter for searching these records?

        Yeah I want to enter a date into a bunch of these records from a query I have loaded into a from a select query.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32668

          #5
          Originally posted by swhipple
          Yeah I want to enter a date into a bunch of these records from a query I have loaded into a from a select query.
          That's to clarify?
          Perhaps you would like to reread your post and rephrase it using real sentences. There was obviously confusion understanding your first post, yet you hit the trigger on your second before checking it made sense.

          Comment

          • jeffstl
            Recognized Expert Contributor
            • Feb 2008
            • 432

            #6
            OK, well Im still not sure exactly what you mean or "where you are at" in terms of getting this to work..

            However, I would just say that it sounds like you want to write code that will loop through an SQL Insert statement with a WHERE clause....

            Like...
            Code:
            Do While Condition
                 sql = "INSERT INTO MyTable (date1) VALUES (MyNewDate) WHERE condition"
                 MyDbConn.execute sql
            loop
            I guess if this is what your looking for try it out and post specific problems you have as your trying it.

            Comment

            Working...