control source

shrive22

Board Regular
Joined
Jun 10, 2002
Messages
120
is there anyway to change the control source of a text box based upon if a record is for a company or an individual?


thanks
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Not sure, but you can get a similar result by having 2 textboxes overlaid, one with the Company controlsource and another with the Individual controlsource. When you update the control indicating Company or Individual, toggle the Visible property so that the appropriate textbox is displayed.

eg: [Control1] allows you to choose Company or Individual
In the AfterUpdate event for this control, this code ---
Code:
If [Control1]="Company" then
  [Text1].Visible=True
  [Text2].Visible=False
Else
  [Text1].Visible=False
  [Text2].Visible=True
End If
Should do the trick. Note: you can determine which textbox displays when you browse records, by inserting similar code in the OnCurrent event of the form. Adjust control names to suit.

HTH

Denis
 
Upvote 0

Forum statistics

Threads
1,221,558
Messages
6,160,485
Members
451,651
Latest member
Penapensil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top