+ Reply to Thread
Results 1 to 2 of 2

Help! Issue with find row and update record

  1. #1
    Registered User
    Join Date
    06-26-2014
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2010
    Posts
    43

    Help! Issue with find row and update record

    Hi

    I have a form that users fill out and then ping the data into a database. This form can be updated so I'm trying to write a macro that finds the original record in the database then replaces it with the new record.

    This is what I've got so far but when it gets to the end of the code I get 'Run time error 1004, Application-defined or object-defined error'.

    The record I'm testing this on definitely exists in the database so I know that's not the issue but that's about as far as I get! I will have to build in something for if the record doesn't exist but just trying to get this part sorted first.

    Please Login or Register  to view this content.
    Can anyone see where I'm going wrong?

    Thanks
    Jo

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,665

    Re: Help! Issue with find row and update record

    1. Match is an Excel/VBA keyword and should not be used as a user variable.
    2. Range(matchRow, 56) is incorrect syntax, "RANGE" expects a string value such as "Q1", "AA45", etc. Or even "C" & MatchRow.
    Assuming that 56 is the number of a column, you would use:
    tgt.Cells(matchRow, 56).Value = wb1.Sheets("Ref").Range("Data").Value
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 20
    Last Post: 11-15-2012, 09:32 PM
  2. Update the Record from ListView
    By ebin charles in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2011, 01:48 PM
  3. Find a previous record and update columns
    By gelandl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-23-2009, 07:00 AM
  4. Update a record in the recordset
    By OverAC in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-07-2006, 04:42 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1