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
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
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.
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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