Run code on form from another form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to run some code on one form from within a second form. The code will
run through some calculations and update a text box on that first form. Then
after running the code, the second form will update a text box to be equal to
the result of the calculations on the first form. Can someone please tell me
the syntax to call the code that should run? This doesn't work:

Call Form_frmBudgetWeekly.Load_Data

Thanks in advance,
 
Glenn Suggs wrote in message
I need to run some code on one form from within a second form. The code will
run through some calculations and update a text box on that first form. Then
after running the code, the second form will update a text box to be equal to
the result of the calculations on the first form. Can someone please tell me
the syntax to call the code that should run? This doesn't work:

Call Form_frmBudgetWeekly.Load_Data

Thanks in advance,

I prefer going through the forms collection

Call Forms("frmBudgetWeekly").Load_Data

but your syntax shoul probably work. Is the sub or function declared
with the keyword Public in stead of Private?
 
Thanks. The function was declared as Private. I changed it to Public and
it's working.
Thanks again,
 
Back
Top