Results 1 to 9 of 9
  1. #1
    Naveen Marapaka is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    33

    How to store values temporarily

    Dear I stuck in small issue.


    I dont want to make my issue so confusing, so if below is solved then this solution can lead to major change in my program.


    I have a subform and with some fields
    and one of the Textbox field name is Intranet_No

    a command button in main form just to show popmessage of the text entered in Intranet_No

    Example Initially My Intranet_no has ABCDEF so when i click button PopupMessage will be ABCDEF

    Now I will edit my Intranet_No as DECDGL so now if i click button i want 2 popupmessgaes with before and after

    like Before ABCDEF
    After DECDGL

    what should be my code to get this

    how to store ABCDEF previous value


    currently i have below

    Code:
    private sub Commandbutton_click()
    
    Dim A1,B1 as string
    
    Set A1 = Me.Details.Form!Intranet_No
    
    msgbox A1
    
    End sub

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    If the form is bound, Access is already storing the value for you, until the user saves the record.

    Msgbox Me.TextboxName.OldValue

    Returns the value before editing.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Also, you have A1 declared as a Variant and B1 declared as a String. If you want both A1 and B1 declared as strings, you have to use

    Dim A1 As String, B1 As String

  4. #4
    Naveen Marapaka is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    33
    Dear I did the same Msgbox Me.TextboxName.OldValue
    but still the msgbox display the current value of the textbox.

    all subform fields are bound to table , so what ever i am editing it is directly updating in table.

    I require to get the previous Value before editing

    how can i get it

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Where do you have the code? I just tested and it worked as expected. You have to be running it before the form updates.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Naveen Marapaka is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    33
    Code is in command button click event.

    private sub Commandbutton_click()

    Dim A1,B1 as string

    Set A1 = Me.Details.Form!Intranet_No

    msgbox A1

    End sub

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Dear, I don't see OldValue anywhere.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    Naveen Marapaka is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    33
    Dear even if i am using Me.Details.Form!Intranet_No.Oldvalue as well.

    still the result is what is currently showing in text field it is displaying in msgbox.

    I just need to store virtually my previous text and show me in msgbox after I edit to new text.

    kindly advise.

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    It worked when I tested it. Can you post your db?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Temporarily Disable Multifield Index
    By datsyuk in forum Forms
    Replies: 6
    Last Post: 07-23-2012, 03:23 PM
  2. Replies: 12
    Last Post: 12-01-2011, 10:28 AM
  3. Hve text combo box values but store integers in field
    By accesshelpasker in forum Access
    Replies: 9
    Last Post: 10-28-2011, 10:49 AM
  4. How would you store this?
    By techneophyte in forum Programming
    Replies: 1
    Last Post: 08-16-2010, 09:09 AM
  5. 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

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