Update Textbox on Form

  • Thread starter Thread starter RickCass
  • Start date Start date
R

RickCass

I would like to know how to update a textbox on a form.

Form name is frmMainMenu.
Textbox name is txtInvoiceNumber.

Please give example I am trying to learn.

RickCass
 
It depends on what and how you want to update it. There are many ways to
change its value. The simplest example of changing it in code that is
running on the form frmMainMenu would be

Me.txtInvoiceNumber = 23

If the code is being run from somewhere other than frmMainMenu then you
would need to replace Me with the full path to the form.

Forms!frmMainMenu.txtInvoiceNumber = 23

If frmMainMenu is a subform, then it isn't "open" so that its name would be
recognized. You would instead have to refer to its Parent form then work
your way down.

Forms!frmParent!SubformControl.Form.txtInvoiceNumber = 23

Notice that in this example the name "frmMainMenu" never shows up. You refer
to a control on frmParent called a subform control instead. This control is
what holds the subform.

Is this what you're after?
 
Back
Top