Results 1 to 2 of 2
  1. #1
    Suzie2012 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    17

    help with Data Macro

    im having issues with getting a value from one table for use in another.

    for instance im creating an invoice, i have a table with all the products listed in it, with columns description and Price, which i need to get information from those in a Line Items Table.

    i have a data macro set up, but when i select the product i want, the data doesnt fill, it just fives me the algorithm used to call the requested data.

    The txt/field box is filled with: [ReturnVars]![retDefaultUnitPrice]


    Here is the Macros i have:

    *NAMED MACRO - LineItemCodes.GetDetails


    Parameter Name:
    prmLineaItemCodeID



    SetReturnVar
    Name: retDefaultUnitPrice
    Expression = 0
    SetReturnVar
    Name: retDefaultDescription
    Espression = ""
    SetReturnVar
    Name: retDiscontinued
    Espression = True

    Look up a Record In SELECT LineItemCodes.ID, LineItemCodes.DefaultUnitPrice, LineItemCodes.DefaultDescription, LineItemCodes.Discontinued FROM LineItemCodes;
    Where Condition = [ID]=[prmLineItemCodeID]

    SetReturnVar
    Name: retDefaultUnitPrice
    Expression = [DefaultUnitPrice]
    SetReturnVar
    Name: retDefaultDescription
    Expression = [DefaultDescription]
    SetReturnVar
    Name: retDiscontinued
    Expression = [Discontinued]
    ----------------------------------------------------
    *AFTER UPDATE - Embedded Macro*


    RunDataMacro
    Macro Name: LineItemCodes.GetDetails

    Parameters
    prmLineItemCodeID = [cboProductID]

    SetProperty
    Control Name: txtUnitPrice
    Property - Value
    Value = [ReturnVars]![retDefaultUnitPrice]

    SetProperty
    Control Name: txtDescription
    Property - Value
    Value = [ReturnVars]![retDefaultDescription]

    SetProperty
    Control Name: txtQuantity
    Property - Value
    Value = 0

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I don't use macros, only VBA, but if you want to provide the project will analyse and try to resolve.
    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. Accessing Data Import wizard via a macro?
    By Madraykin in forum Import/Export Data
    Replies: 6
    Last Post: 03-27-2012, 12:34 PM
  2. Widecard characters in Data-macro
    By abrian98 in forum Access
    Replies: 2
    Last Post: 09-01-2011, 07:43 PM
  3. Assist to create Data Macro
    By rkalapura in forum Programming
    Replies: 3
    Last Post: 07-30-2011, 11:12 AM
  4. Get External Data Macro
    By Harley Guy in forum Access
    Replies: 2
    Last Post: 11-16-2010, 12:20 AM
  5. Replies: 2
    Last Post: 08-24-2010, 03:32 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