how to pass value of textbox from subform to main form in vb

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • noorulain
    New Member
    • Jul 2013
    • 1

    how to pass value of textbox from subform to main form in vb

    i want to pass the value of text box from a subform "concession " to a main form "student_detail " i am using the format
    forms!mainform name!subform name!ftextboxna me.value
    to assign the textbox value to a variable
    and when i want to display the result in an other textbox on same subform i use the format
    forms!subformna me!textbox name.value=vari able name
    but it is not working
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    That is because you are not referencing the subform and contrls correctly. Please take a look here:
    ACC: How to Refer to a Control on a Subform or Subreport
    To refer to a control on a subform, use the following syntax:

    Code:
       Forms![main form name]![subform control name].Form![control name]
    To refer to a control on a subreport, use the following syntax:

    Code:
    Reports![main report name]![subreport control name].Report![control
       name]
    It is important to note that you cannot refer to controls on a subform with the following syntax:

    Code:
    Forms![subform name]![control name]

    Comment

    Working...