Results 1 to 3 of 3
  1. #1
    viruzman is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    1

    Command Like DLookup but to store a string

    Hello averyone



    i was just wondering if there was a command like DLookup But To Store A New Peice of info, or to replace the old peice of info.


    DLookup("strEmpName", "tblEmployees", "strEmpName = text0")
    something like this, but where text0 would be the new peice of info i would like to store according to the strEmpName .


    thank you

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Why would you want to store it and not build it on the fly?

    DLookup("strEmpName", "tblEmployees", "strEmpName = '" & forms!<formname>!<fieldname> & "'")

    where formname and fieldname would be the form that is supplying the information and the fieldname would be the criteria string.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Storing/Replacing data programatically requires VBA code running an SQL action statement (INSERT or UPDATE).

    DoCmd.SetWarnings False
    DoCmd.RunSQL "INSERT ..."
    DoCmd.RunSQL "UPDATE ..."
    DoCmd.SetWarnings True

    Why aren't you just opening form and entering the correct info?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 07-25-2011, 08:27 AM
  2. How to store data many row in one table
    By dododo in forum Access
    Replies: 4
    Last Post: 06-25-2011, 12:42 AM
  3. How would you store this?
    By techneophyte in forum Programming
    Replies: 1
    Last Post: 08-16-2010, 09:09 AM
  4. How do I get dlookup values to store in table
    By rpmyhero in forum Access
    Replies: 1
    Last Post: 11-25-2009, 05:57 AM
  5. # added to string with Dlookup
    By normever in forum Programming
    Replies: 1
    Last Post: 02-27-2009, 10:52 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