Results 1 to 3 of 3
  1. #1
    AlphaC is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Apr 2016
    Posts
    5

    Assigning a value from a macro on a form to a field in a subform

    Hello,


    Looking for help from my agony! Warning ...newbie.

    trying to update a subForm field with a value or a calculation from fields in the mainForm. I am running a procedure onClick from the mainForm.
    no problem getting and seeing values with the mainform

    In a public procedure (onClick from mainForm) I'm trying to use a value from a calc of two fields "fieldValue1" x "fieldRate1" and I'm trying to assign this value to a record "subfieldInterest" in the Detail section of subForm (inside of mainForm. I think I've tried every iteration of the combination possible but get various errors. I will be running this through a loop so I will need to repeatedly update the records of each new line in the subForm.

    the last iteration I used was Me.[subfieldInterest] = value
    also tried amongst others
    Forms![mainForm]![subForm].Form![subfieldIntrest] = value


    Any takers? thanks in advance.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    if I've understood you correctly, what you need is

    subForm.Form.subfieldIntrest = value

    where subform is the name of your subform control

    see this link how to refer to controls in other forms

    http://access.mvps.org/access/forms/frm0031.htm

  3. #3
    AlphaC is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Apr 2016
    Posts
    5
    thanks...your suggestion worked..I know I've been through the link and tried it 20 different ways..... not sure what else to say but thx!!!

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

Similar Threads

  1. Replies: 1
    Last Post: 08-13-2015, 06:12 AM
  2. Replies: 3
    Last Post: 05-07-2015, 08:56 PM
  3. Assigning Macros to Buttons using the Macro Builder
    By AccessN00bee in forum Macros
    Replies: 17
    Last Post: 10-23-2014, 08:46 PM
  4. Replies: 2
    Last Post: 10-09-2013, 05:45 PM
  5. Macro for visible field in subform
    By g=2012 in forum Access
    Replies: 7
    Last Post: 09-11-2012, 02:23 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