Results 1 to 3 of 3
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    copy data error


    this short snipet is meant to copy the values of all fields in one record to the record currently being displayed in form frmSpec; it's not working... and the error is the allusive #2465 (both the form and the recordset have the same source table: tbeFixtureTypeDetails; but both would never be the same record)

    any thoughts, comments or suggestions will be greatly appreciated


    Private Sub cmdNextNumeric_Click()
    Set Db = CurrentDb()
    Set rst = Db.OpenRecordset("SELECT * " & _
    "FROM tbeFixtureTypeDetails " & _
    "WHERE tbeFixtureTypeDetails.type = '" & Me.[lblInitialAlpha].Caption & "';")
    For Each fld In rst.Fields
    strFieldName = fld.Name
    ' ****** it's this next line that is giving me problems
    Forms![frmSpec].Fields(strFieldName) = Nz(fld.Value)
    ' ******
    Next fld
    Forms![frmSpec].Update
    End Sub


    many thanks in advance,
    mark

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    If you are displaying the records from a table on a Form, why not use a bound form?

    Perhaps you should tell us what you are trying to do, and someone may help you with options on how to do it.

    This is a new one to me
    Forms![frmSpec].Update

  3. #3
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    i am copyting data from an existing record to a newly created record that is currently displayed

    the new record wil not be a complete duplicate of the existing, and the user typically will not know that they want the to create a 'similar' record till after they have started entering data into the new (and current) record (I do have code in place, although edited out of the snipet, that would prevent any data that the user has already entered in the new record from being overwritten -it would typically be only 2 or 3 fields)

    the duplicated data is not "redundant"; and could, and most likely will be, edited, at a future time, indepenadanlty in each record.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Copy data from one form to another
    By rcrobman in forum Programming
    Replies: 12
    Last Post: 05-24-2011, 01:25 PM
  2. Copy Database Code Error
    By Tomfernandez1 in forum Programming
    Replies: 5
    Last Post: 05-03-2011, 12:21 PM
  3. Copy data from Tables in VBA
    By MattyT in forum Programming
    Replies: 4
    Last Post: 12-24-2010, 10:07 AM
  4. Access copy/paste error in Shared mode
    By somm in forum Access
    Replies: 6
    Last Post: 12-16-2010, 08:59 AM
  5. Replies: 0
    Last Post: 09-21-2008, 11:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums