this code makes my access stop working!

behedwin

Active Member
Joined
Dec 10, 2014
Messages
399
Every time i run below code and the If statement is true, my access freezes up.

Code:
'count characthers in textbox
If Len(Me.txtpersonnummer.Text) = 10 Then
Me.WarningPersonnummer.Visible = False
Me.txtpersonnummer.BackColor = vbWhite
Exit Sub
Else
Me.WarningPersonnummer.Visible = True
Me.txtpersonnummer.BackColor = vbBlue
End If

If i remove so i have 9 numbers in the textbox called txtpersonnummer.
Then it all works.
But if i then put back 10 charachters in the textbox. My access locks up and i need to restart it.

Anyone got any idea of why?
 
Well i have tried to remove both the echo and the painting code.
It did not do any difference for me.

Edit: wrong by me.
i tested it again and removed echo code.
then the error dissapeard.
so it was all allong the
Application.Echo False
and
Application.Echo True
that froze access.
 
Last edited:
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Yes, it makes sense now that I think of it. Are you sure you need these things? I haven't had to use echo or painting except in extremely rare cases.
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,953
Members
448,535
Latest member
alrossman

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