command buttons

  • Thread starter Thread starter patric
  • Start date Start date
P

patric

Greetings,
I have two command buttons A and B which are connected to subforms on the
main form.I have a table"Client" and field "A/B". My goal is when I click
amdA I want the field "A/B" show A, whe I click cmdB I field "A/B" will show
B. If any solution? For me it's puzzle.Thx. --
Patric
 
Patric,

Assuming that the control you want to populate on the main form is named
'A/B', put the following code in the On Click event for button A:
Forms![Name of main form]![Name of sub form control].Form![A/B] = A

In the On Click event for button B:
Forms![Name of main form]![Name of sub form control].Form![A/B] = B

Of course you will need to use the actual name of your form instead of 'Name
of main form' and make sure that you use the name of the sub form control
which may or may not be the same as the name of your sub form. If you need
more help with this I will try to explain.
 
Back
Top