[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Cancel MSAccess message on status bar.

Posted on 1999-12-19
23
Medium Priority
?
346 Views
Last Modified: 2006-11-17
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?
0
Comment
Question by:mdanny
  • 8
  • 5
  • 4
  • +2
23 Comments
 
LVL 9

Expert Comment

by:BrianWren
ID: 2293595
Is your form single of continuous?

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

Brian
0
 
LVL 1

Author Comment

by:mdanny
ID: 2293637
single form detail section
0
 
LVL 1

Expert Comment

by:jschrisman
ID: 2293656
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 new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 9

Expert Comment

by:BrianWren
ID: 2293710
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
 
LVL 1

Expert Comment

by:tuck
ID: 2296642
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
 
LVL 9

Expert Comment

by:BrianWren
ID: 2298699
mdanny,

Is your problem solved?

Brian
0
 
LVL 1

Author Comment

by:mdanny
ID: 2300079
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
 
LVL 9

Expert Comment

by:BrianWren
ID: 2301043
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
 
LVL 1

Expert Comment

by:jschrisman
ID: 2301054
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
 
LVL 9

Expert Comment

by:BrianWren
ID: 2301123
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
 
LVL 1

Expert Comment

by:jschrisman
ID: 2301183
Woops. Good point, Brian.
0
 
LVL 1

Expert Comment

by:tuck
ID: 2301831
I would put what I suggested in the GotFocus event of the control or controls.
0
 
LVL 1

Author Comment

by:mdanny
ID: 2302596
To tuck.Tried it doesn't work.Sorry
0
 
LVL 9

Expert Comment

by:BrianWren
ID: 2303531
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
 
LVL 1

Author Comment

by:mdanny
ID: 2318303
To BrianWren.Tried it.Doesn't work either.Sorry
0
 
LVL 1

Expert Comment

by:tuck
ID: 2319410
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
 
LVL 10

Expert Comment

by:brewdog
ID: 2367283
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
 
LVL 1

Author Comment

by:mdanny
ID: 2390355
to brewdog : I need to use the click event
0
 
LVL 9

Expert Comment

by:BrianWren
ID: 2390471
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
 
LVL 10

Expert Comment

by:brewdog
ID: 2390495
That's what I was thinking, too, Brian . . . but will Access let an invisible control receive a click event?
0
 
LVL 9

Accepted Solution

by:
BrianWren earned 150 total points
ID: 2390585
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
 
LVL 10

Expert Comment

by:brewdog
ID: 2392900
ah, you're right. My bad. :o)
0
 
LVL 10

Expert Comment

by:brewdog
ID: 2478893
any news here, mdanny?
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question