cannot get updated values from textbox or label

  • Thread starter Thread starter jameeesy
  • Start date Start date
J

jameeesy

hi,

in access vba i have an onload sub (in a subform) that load values out
of a database and into the labels of a the subform. then if the user
clicks, say, a label, its value changes.

onload:
labelX.Caption = "valueXYZ"

onClick:
labelX.Caption = "valueXXYYZZ"

now when i run a function to retrieve this new label caption
("valueXXYYZZ") it actually retrieves "valueXYZ"

function (in module):
declare database & recordset & variable
variable = subformABC.labelX.Caption

but looking at "variable" it is actually still "valueXYZ" not
"valueXXYYZZ".

why won't it retrieve the updated label caption??
 
actually figured it out all on my own.

function (in module):
declare database & recordset & variableX

variableX = Form_FormName.SubFormName.Form.LabelName.Value

yay!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top