populate txtbox based off another..cbobox & dlookup invo

foxhound

Board Regular
Joined
Mar 21, 2003
Messages
182
I have a text box (“txt_prespercent”) that is looking up a value in a table based off a value in my combo box (“cmbo_prespercent”). Anytime the value in “txt_prespercent” changes, I want to update another text box (“prespercent”) which has a control source from a field called “prespercent” in the underlying table that the form is based off. How can this be done?

Foxhound
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Re: populate txtbox based off another..cbobox & dlookup

Hi foxhound,

May be oversimplifying this but wouldn't this work:

Code:
private sub cmbo_presercent_afterupdate()

    'put this after you update txt_prespercent with looked up value
    prespercent.value = txt_prespercent.value

end sub
 
Upvote 0
Re: populate txtbox based off another..cbobox & dlookup

Corticus,

You did not oversimplify. I had one of those blurry eyed moments when things just didn't look right. Your code was perfect. Thank you :biggrin:
 
Upvote 0
Re: populate txtbox based off another..cbobox & dlookup

Wow,

Can't believe that worked, I wanted it to be harder. You should have seen the first answer I posted, I had DAO, and lookups and all kinds of stuff.

Glad it worked for you,
 
Upvote 0

Forum statistics

Threads
1,221,573
Messages
6,160,593
Members
451,657
Latest member
Ang24

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