Set value to another form's field

billchow24

New member
Local time
Today, 03:33
Joined
Apr 18, 2010
Messages
4
I am writing VBA on Microsoft access
Do anyone know how can i set a value of a form's field by using VBA?
For example, I am writing the VBA code on form A and want to set value to a field in form B (because I haven't learnt how to pass value between forms)

Or
How can i write VBA to open a new form with value set to a particular field?



Can anyone help me? I have been doing this for 4hr and still can't find the solution.
Thanks very much
 
With both forms open, try:
Me.NameOfSomeControl = Forms!NameOfForm!NameOfSomeControl

If the form or control names have spaces, enclose the object names in square brackets.
 
With both forms open, try:
Me.NameOfSomeControl = Forms!NameOfForm!NameOfSomeControl

If the form or control names have spaces, enclose the object names in square brackets.

Thank you very much!!
Problem solved
 

Users who are viewing this thread

Back
Top Bottom