+ Reply to Thread
Results 1 to 8 of 8

Excel/Access update records

  1. #1
    Registered User
    Join Date
    07-19-2013
    Location
    United Kingdom
    MS-Off Ver
    Office 2007
    Posts
    89

    Question Excel/Access update records

    Good morning,

    Im a little confused as to how to get this to work.
    I have a userform that when filled in sends the data to MS Access to store as a database. (i have to use it this way as users dont have use of Access I can only use it to store data)

    However, there is a time where the record thats been added needs to be changed.

    How do I code a button to locate the record to be able to update? If the users are adding a unique reference everytime.

    Ideally, I'd want the empty boxes to populate with what the record states so this can be changed..
    (ps. Excel & Access 2007)

    Thanks in advance.
    Last edited by Raanan; 02-18-2014 at 07:41 AM.

  2. #2
    Registered User
    Join Date
    07-19-2013
    Location
    United Kingdom
    MS-Off Ver
    Office 2007
    Posts
    89

    Re: Excel/Access update records

    For example im using

    Please Login or Register  to view this content.
    But I cant get the search part to work correctly to find the item in the database

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Excel/Access update records

    What is Search and how does it get a value?

    Also is the field [Claim Number] numeric or text?

    Is the field name 'Claim_Number' or 'Claim Number'?

    PS If you want to return other fields eg Recommendations you'll need to include them in the query.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    07-19-2013
    Location
    United Kingdom
    MS-Off Ver
    Office 2007
    Posts
    89

    Re: Excel/Access update records

    Norie, to be honest I'm not sure Ive been trying to search various areas and this was a hashed up code to find.

    basically I need to use the txtclaim text box as the "search" area.
    so when they click lblupdate it then searches for the number (and its numerical) and returns the record that matches what was input in there.


    The field in Access is Claim Number.

    I've tried all sorts of different ways i thoguht it would be a simple code.. but alas.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Excel/Access update records

    The query isn't quite right.

    For a start if the field is numeric then you don't need the single quotes around the search term.

    Also what is the field name?

    In your query you call it 'Claim Number' and 'Claim_Number', it can't be both unless you are actually referring to 2 different fields.

    Finally the query only returns one field, the claim number, but you refer to 2 other fields, ongoing and recommendations.

    If you want the values from those fields you need to include them in the field list.

  6. #6
    Registered User
    Join Date
    07-19-2013
    Location
    United Kingdom
    MS-Off Ver
    Office 2007
    Posts
    89

    Re: Excel/Access update records

    Ok, I think i get it.

    The field in Access is "Claim Number" yes I'd want ongoing and recommendations as they would be the only fields I'd want to be able to edit. Do i put that after "WHERE"?

    Like i say a lot of this is hashed up code and im sure Ive confused it all somewhere.

    would i be looking more like:
    Please Login or Register  to view this content.
    if i removed the "WHERE" would it pull the whole data on it?

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Excel/Access update records

    Why did you remove the WHERE?

    If the field name is 'Claim Number' you'll need to use [Claim Number] in the query.

    One way of getting the syntax for the query would be to open the database, create an example query in the Query By Example view and then goto SQL view.

  8. #8
    Registered User
    Join Date
    07-19-2013
    Location
    United Kingdom
    MS-Off Ver
    Office 2007
    Posts
    89

    Re: Excel/Access update records

    ah yes, That helped.. managed to get the query back into the UF which is handy..

    now to be able to update the record rather than it creat a new one..

+ 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. [SOLVED] need to be able to update records with button click and delete records sample included
    By unreal11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-25-2013, 11:45 PM
  2. Excel Table to Access Records
    By GBR2L in forum Excel General
    Replies: 3
    Last Post: 12-10-2010, 04:59 PM
  3. Linking Access Records to Excel
    By MayraEllen in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-21-2006, 02:40 PM
  4. Access Records into Excel
    By KJGradwell in forum Excel General
    Replies: 2
    Last Post: 10-04-2005, 02:05 AM
  5. [SOLVED] export access to excel. change access & update excel at same time
    By fastcar in forum Excel General
    Replies: 0
    Last Post: 06-24-2005, 05:05 PM

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