Continuous Form VBA Code - is it possible?

Mr Retirement

New Member
Joined
Nov 12, 2016
Messages
46
Hello all!

I have a combobox with a dropdown of information that has multiple columns (from a query). In a normal (single) form, I normal use the 'on change' event and reference the other various columns that wasn't selected to change other text boxes on the form.

For example:
VBA Code:
Me.TXTexamplebox1.Value = Me.InitialDropdownSelection.Column(2)
Me.TXTexamplebox2.Value = Me.InitialDropdownSelection.Column(3)

Is something like this possible in a continuous form? How can I code the specific textbox that i'm looking to change? Because as the next record becomes available, I want it only to change that text box on change... not all of the text boxes.

Hopefully this makes sense - a little hard to explain.

Any advice is appreciated!!!

Thanks,
Mr R
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Mr Retirement

New Member
Joined
Nov 12, 2016
Messages
46
Apologies... it works the exact same way - not sure why it wasn't working earlier... but I guess it is solved haha
 

Micron

Well-known Member
Joined
Jun 3, 2015
Messages
2,019
Office Version
  1. 365
Platform
  1. Windows
Not sure if you realize this or if it even matters, but FYI - the change event happens every time you type a character in a control that has that event. Perhaps also might be helpful to point out that if your post refers to a single field (aka a specific control on a form) and that form is a continuous form, there is only 1 of any such control. Every instance of that control that you see in the records is just a copy of it. If it is bound, Access will distinguish one from the other. If it is not, whatever you do to it (data-wise) will propagate to all the copies. That includes some other things as well, such as some properties (conditional formatting is another matter). You show textbox1 and textbox2 but don't say if they represent one field or each one is bound to a different field. I have to presume the latter since you seem to have arrived at a solution. You might want to consider using a different event - say, AfterUpdate. I'm fairly certain that the change event will also fire after you have made a list selection, but as I noted, it will also fire on almost every keystroke if you type into it.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,534
Messages
5,596,729
Members
414,093
Latest member
Tegglet

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
Top