Results 1 to 4 of 4
  1. #1
    chrismec is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2009
    Posts
    3

    Record Value in Visual Basic


    Hello All. I am new to access and cant seem to get past this stumbling block.

    I need to add values from different records in a table in visual basic. I understand that I can add values from the same record with the following method:

    Code:
    Me.NewValue = Me.Value1 + Me.Value2
    What I need is to add a value from the current record with the value from a different record. Such as:

    Code:
    Me.NewValue = Me.Value1 + AnotherRecord.Value2
    But I can not seem to find what code I need to insert in place of 'AnotherRecord'.

    Thanks for your help!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You would probably need to do a DLookup() to get the other value.

  3. #3
    chrismec is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2009
    Posts
    3
    Thanks RuralGuy! Dlookup works great!

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're welcome. Do you want to go ahead and follow the link in my sig and mark this thread as Solved?

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

Similar Threads

  1. Using Access Instead of Visual Basic
    By dinz in forum Programming
    Replies: 2
    Last Post: 12-19-2019, 10:33 AM
  2. microsoft visual basic REFERENCE
    By marianne in forum Access
    Replies: 0
    Last Post: 04-01-2009, 08:06 PM
  3. Basic Question
    By chris11590 in forum Forms
    Replies: 0
    Last Post: 08-04-2008, 05:57 AM
  4. Problem when activate the Visual Basic Editor
    By milo in forum Programming
    Replies: 0
    Last Post: 05-21-2007, 09:05 AM
  5. Visual Basic ToolBar and ImageList
    By Athanasopolous in forum Programming
    Replies: 0
    Last Post: 01-17-2006, 03:45 PM

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