Filling bound controls in a form with calculated results

D

David T. Allison

I have a form that a user may partially fill with text and numbers that
could then be used to calculate numerical results that could fill in other
blank fields in the same form. My idea would be to have a un-bound button in
the upper title bar of the form that the user could click after filling in
some of the initial fields, and this action would calculate numerical
results via VBA functions or procedures, the results then being used to fill
in multiple field values I know how to write the VB functions/procedures to
calculate the results, but I'm not sure where to use the
functions/procedures in the form itself,

Regards,
David
 
J

John W. Vinson

I have a form that a user may partially fill with text and numbers that
could then be used to calculate numerical results that could fill in other
blank fields in the same form. My idea would be to have a un-bound button in
the upper title bar of the form that the user could click after filling in
some of the initial fields, and this action would calculate numerical
results via VBA functions or procedures, the results then being used to fill
in multiple field values I know how to write the VB functions/procedures to
calculate the results, but I'm not sure where to use the
functions/procedures in the form itself,

Not sure what you're asking here.

You don't need any buttons or any code to calculate numerical results; you can
simply set the Control Source of a textbox on the form to an expression
calculating on the basis of other controls, e.g.

=[SomeControl] * ([ControlA] + [ControlB])

Or you can set the control source to

=YourFunctionName(parameter1, parameter2)

to call a VBA function.

John W. Vinson [MVP]
 

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

Top