Textbox value on form "BeforeRender"

SDowse

Board Regular
Joined
Sep 23, 2009
Messages
110
Hi,

I have a form (from_TOC), with a Tab Control (tabCtl15) inside it, with a Page (DDValidation) and a textbox (Text7) on it...

In the form BeforeRender I want to put a calculation to set the value of Text7.

I have worked out how to do it for a textbox that does not sit with tabCtl15, but I cannot work out how to do it for a textbox within DDValidation. Any ideas.

I want Text7 = Format(DCount("[Account_No]", "qry_DD_Date_MisMiatch"), "#,#")

Thanks in advance for any help.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

jackd

Well-known Member
Joined
Oct 19, 2006
Messages
1,318
Office Version
  1. 365
Do you get an error? Do you have some sample results? Is there a spelling error on MisMiatch?
Can you post a copy of the database with just enough data/info to highlight the issue?
 

SDowse

Board Regular
Joined
Sep 23, 2009
Messages
110
Hi - thanks for the reply.

1. I do not get an error - the box does just not populate with any value
2. There is a spelling error on MisMiatch as such, but that is replicated across the form. As this is just a sandbox, I am not to worried
3.. I will try and provide a copy of the database

However, whilst happily typing this post I was able to make a value populate in a textbox outside of the tabcontrol, using BeforeRender. But since writing this post I have not - for some reason it stops working, not sure why. I was switching between Design and Form view, and then closed the form and unable to get the BeforeRender to work on anything.

So, I have put the calculation into the OnLoad function - but this means the form takes too long to load. I have tried to Analyse Performance, but it's not made any difference. The query is only counting about 800 records (currently) so not sure why it is taking so long?
 

Watch MrExcel Video

Forum statistics

Threads
1,129,734
Messages
5,638,052
Members
417,001
Latest member
MSteel

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