Flashing labels?

  • Thread starter User via AccessMonster.com
  • Start date
U

User via AccessMonster.com

Hello,
When the user first opens my form all the textboxes are disabled except for a
combobox. The user must first select an item form that combobox. The coding
enables only the specified textboxes that are required for their selection.
I user should enter information into all enabled textboxes before the entry
is allowed. The problem I’m having is that there’s nothing preventing the
user from not entering everything.
What I was thinking is prompting the user that they “have not entered all the
appropriate informationâ€. When they hit ok, they’re returned to the form, and
if an enabled textboxe(s) do not have information entered into they will now
flash their labels to help the user identify what is missing. When
information is entered they stop flashing. Now once everything is entered
correctly the entry will now be allowed.

Can anyone help?

Thanks
 
T

Tom van Stiphout

On Sat, 12 Sep 2009 04:29:43 GMT, "User via AccessMonster.com"

Let's not flash labels - that is tacky and is reminiscent of MS-DOS
days with blinking characters.
Your issue is simply dealt with by writing code in the
Form_BeforeUpdate. This is where you check if all enabled textboxes
are filled out, and if not you bitterly complain and set Cancel=True
so user cannot move on until the condition is satisfied.
Code could be something like (off the top of my head):
dim ctl as control
for each ctl in me.controls
if typeof ctl is textbox then
if ctl.Enabled then
if isnull(ctl.Value) then
Msgbox "Yo! Fill out " & ctl.Name, vbCritical
Cancel=True
end if
end if
next ctl

-Tom.
Microsoft Access MVP
 
D

Douglas J. Steele

Tom van Stiphout said:
On Sat, 12 Sep 2009 04:29:43 GMT, "User via AccessMonster.com"

Let's not flash labels - that is tacky and is reminiscent of MS-DOS
days with blinking characters.

Not only that, but depending on the rate of flashing, it can cause problems
for people with epilepsy!
 
S

Stuart McCall

Douglas J. Steele said:
Not only that, but depending on the rate of flashing, it can cause
problems for people with epilepsy!

Not only that, but setting the label forecolor to red (an alternative which
is commonly used) can cause problems for people with colour-blindness!
 
A

Arvin Meyer [MVP]

So were going to set it to a neutral color and make sure the flash is very
slow (no faster than a 1/2 second between flashes). Alternatively, one can
give up the entire idea and use a message box.
 
U

User via AccessMonster.com

I understand everyone's concern, but the blinking/flashing is necessary in
this case and is only used when something is missing. The slow
flashing/blinking will help alert the user to what they are missing in the
form. Please help.
 
U

User via AccessMonster.com

I guess the back color property could can if something is missing. Thanks
 
A

Arvin Meyer [MVP]

This will flash 5 times at 1/2 second intervals:

Private Sub Form_Timer()

Dim j As Integer

For j = 1 To 5
If Me.Label1.Caption = "Whatever" Then
Me.Label1.Caption = ""
Me.TimerInterval = 500
Else
Me.Label1.Caption = "Whatever"
Me.TimerInterval = 500
End If
Next j

End Sub

You can change it to include a greater or lesser numbers of flashes.
Flashing is annoying and will quickly alienate your users, which is why I
set it to 5. Set the form's timer interval initially to a number between 0
and 1000 (1 second)
 
U

User via AccessMonster.com

When the user first opens the form all the textboxes are disabled except for
a combobox.

The user must first select an item form that combobox.

The existing code enables only specified textboxes required of the users
selection.

The user should enter information into all of the enabled textboxes before
the entry is allowed.

When the user presses the cmdAdd, the code should make sure that all enabled
textboxes have information entered in to them.

If not, a message should prompt the user that they “have not entered all the
appropriate informationâ€. The only command button in messagebox should an ok.
When the user hits ok, they’re returned to the form, and the required
textboxe(s) that do not have information entered in them will now begin to
slowly blink their labels. As this will help the user identify what is
missing.

The form has 50+ textboxes and comboboxes.

Once the information is entered they stop blinking. Now once everything is
entered correctly user presses cmdAdd and the entry will now be allowed.

Can anyone help?

Thanks
 
A

AccessVandal via AccessMonster.com

A simple but not so nice code timer event you can try.

Declare a variable on top of your code

Option Compare Database
Option Explicit
Dim cnt As Integer

Set to counter to 0 with the Open or OnLoad event of your form.

Private Sub Form_Load()
cnt = 0
End Sub

And in the form do something like these in the On Timer event…..

Private Sub Form_Timer()
cnt = cnt + 1
If cnt = 2 Then
Me.Label1.Visible = False
Else
Me.Label1.Visible = True
cnt = 1
End If
End Sub

In the form’s Timer Interval, set it to something like 500 more or less until
you feel the comfortable.

And if your users still can bypass whatever you have tried, install a
reloadable multicartridge Flash Grenage at the back of their monitor.

Come back to ask for help if you need with coding. I’m sure everyone is
willing to help.
 
A

Arvin Meyer [MVP]

Are you able to write any VBA code? If so, you can adapt the code in
FixNames:

http://www.datastrat.com/Download/FixNames2K.zip

and/or LockIt:

http://www.datastrat.com/Code/LockIt.txt

to iterate through all the controls on your form, and check to see if all
controls are filled. Then turn on the flashing label, or just turn the form
background red, or don't let them move to the next record.

With 50 controls on a form, users will invariable miss, or otherwise not be
able to fill out the entire form. When that's the case, they will, be
frustrated if you challenge them, and eventually, your database will be full
of garbage, or the users will figure out some way to get even.

I suggest that you do some re-thinking about the goals you wish to
accomplish, and perhaps come up with an alternative.
 
U

User via AccessMonster.com

Thank very much! I'm going to try and write something with the information
you and everyone else has provided.

Thanks again!!
Are you able to write any VBA code? If so, you can adapt the code in
FixNames:

http://www.datastrat.com/Download/FixNames2K.zip

and/or LockIt:

http://www.datastrat.com/Code/LockIt.txt

to iterate through all the controls on your form, and check to see if all
controls are filled. Then turn on the flashing label, or just turn the form
background red, or don't let them move to the next record.

With 50 controls on a form, users will invariable miss, or otherwise not be
able to fill out the entire form. When that's the case, they will, be
frustrated if you challenge them, and eventually, your database will be full
of garbage, or the users will figure out some way to get even.

I suggest that you do some re-thinking about the goals you wish to
accomplish, and perhaps come up with an alternative.
When the user first opens the form all the textboxes are disabled except
for
[quoted text clipped - 29 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top