Cancel MSAccess message on status bar.

I have a calculated textbox control on my form.Is it possible to make custom message or just cancel alltogether the annoying message on status bar "Control can't be edited because it's bound bla.. bla. .bla.. " when I try to type in the textbox?
LVL 1
mdannyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BrianWrenCommented:
Is your form single of continuous?

What part of the form is the control in:  Header/footer, or Detail?

Brian
0
mdannyAuthor Commented:
single form detail section
0
jschrismanCommented:
I'm not sure of any way to prevent that message from coming up in the status bar. It doesn't throw a trappable error or anything. Maybe someone else knows.

I suspect that what you need to do is to set the Enabled property to "No" and the Locked Property to "Yes" on the controls Data tab. That way the user can't even get into the control to see the message. If it's a calculated control I can't think of any reason the user would need to get into the control.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

BrianWrenCommented:
In the OnCurrent event of the form, fill in the text box with the value that you are currently setting the ControlSource to:


Private Sub Form_Current()
  Me!fld = <calculation>
End Sub


Leave the Control source of the text box empty.

The reason I asked if it was Single or continuous is that if you do this on a continuous form, all of the controls in that column get the same contents.  On a single form that's not a problem.

Then, since the control is not 'hard coded,' Access will let yo uchange the value.

Brian
0
tuckCommented:
To clear the message you could do this
Dim ss As Variant
ss = SysCmd(acSysCmdClearStatus)

To add messages
ss = SysCmd(acSysCmdSetStatus, "Your message")

but I do not think you can trap the first instance of the message getting on the status bar.
You could maybe put the code in the focus event of the control that makes the message appear..I will have to try it.
0
BrianWrenCommented:
mdanny,

Is your problem solved?

Brian
0
mdannyAuthor Commented:
To All :
Sorry I was ill for a while so I'm a bit late with my reaction.
 
To Tuck:Which event should trigger this function?
To BrianWren:
Sorry single form was a sample form I tried on.The actual form is continuous.
To jschrisman:
You're right.What I did was to set enabled=false.
But on some controls I have to use click
event so this I still don't know how to achieve.
0
BrianWrenCommented:
Does the user need to be able to actually access this control, or do they just need to be able to read it?

(Glad you're feeling better!)

Brian
0
jschrismanCommented:
OK, I've got another solution. Reset the enabled property to true and set the locked locked property to true.

Remove the formula from the control source property; making the control unbound.

In the forms OnCurrent event, set the value of the control to the formula. Also remember if there are any other controls on the form that the formula depends on you will have to reset the formula on those controls AfterUpdate event.

The sample source is from a form with 2 controls. The Text0 control is the one that is locked and enabled; it is also the one that is calculated.

Option Compare Database
Option Explicit

Private Sub Form_Current()
Text0 = Text4 * 10
End Sub

Private Sub Text0_Click()
Debug.Print "Click"
End Sub

Private Sub Text4_AfterUpdate()
Text0 = Text4 * 10
End Sub

Hope this solves the problem for you.
0
BrianWrenCommented:
Setting the control's contents this way will cause each visible control to have the same results--the results for the current record...

(That's why I asked in the first place whether the form was single or continuous.)

Brian
0
jschrismanCommented:
Woops. Good point, Brian.
0
tuckCommented:
I would put what I suggested in the GotFocus event of the control or controls.
0
mdannyAuthor Commented:
To tuck.Tried it doesn't work.Sorry
0
BrianWrenCommented:
You can put the code to clear the status bar in the On Timer event, and set the timeinterval to 0.  When it is 0, that event doesn't happen.  At the point where the error can show up, (like in the GotFocus, change the TimerInterval to 100 miliseconds, (Me.TimerInterval = 100)

When the error happens, 0.1 Sec later it will be cleared.  This will keep happening as long as there is a timerinterval.  

Then on LostFocus of the control, set the timerinterval back to 0, and that event will cease taking place.

Brian
0
mdannyAuthor Commented:
To BrianWren.Tried it.Doesn't work either.Sorry
0
tuckCommented:
What about hidding the status bar completely, when the form opens
Application.SetOption "Show Status Bar", False
when the form closes
Application.SetOption "Show Status Bar", True


Just an idea...
0
brewdogCommented:
I don't think I read an answer to the question: do users need to be able to edit the control or just view it? If it's the latter, then why wouldn't the Enabled = No and Locked = Yes work? That will leave the control shown nicely but users won't be able to get into the field to do anything, and therefore can't see the message . . .
0
mdannyAuthor Commented:
to brewdog : I need to use the click event
0
BrianWrenCommented:
They can click a control that is enabled and locked.

Or you could set Enabled = No and Locked = Yes an put a transparent object over the top of it to receive the mouse click.

(I like the second best, becaue it will intercept everything you try to do to the contents of the control using the mouse, and you can't get into the control using the keyboard.  The message never appears, because no way to edit it exists.

Brian
0
brewdogCommented:
That's what I was thinking, too, Brian . . . but will Access let an invisible control receive a click event?
0
BrianWrenCommented:
Not invisible;  transparent.

This is a property you can set on command buttons.  If the text box has the focus, (as is the case on my test form), and you click there, the textboxes click event fires.  If the focus is NOT in the text box, the button click event fires.  So the box must not get the focus, (Tab stop = no).

Transparent buttons can be really useful.

Brian
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brewdogCommented:
ah, you're right. My bad. :o)
0
brewdogCommented:
any news here, mdanny?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.