Page 1 of 4 1234 LastLast
Results 1 to 15 of 46
  1. #1
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117

    Flashing label

    I have a label (label279) on a form which becomes visible if a check box (NEWPART) is ticked.

    This is the code against the Form's Current event


    Private Sub Form_Current()
    If Me.NEWPART = -1 Then
    Me.Label279.Visible = True
    Else
    Me.Label279.Visible = False
    End If
    End Sub

    This works fine.

    Can the code be modified sso that not only does the label become visible but it also fl;ashes in some way so there is no doubt that the user is aware of the message

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Flashing on the screen has been known to invoke medical issues with some. Your code can be shortened to just: Me.Label279.Visible = Me.NEWPART

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    you can use the form timer event

    set the timer interval to say 3000 (for 3 seconds)

    in the form timer event put

    Me.Label279.Visible = not Me.Label279.Visible

    However agree with Allan - generally not considered a good idea

    Better to make the label stand out - perhaps use a red background or something with the borders or font

  4. #4
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117
    Thanks to you both for your replies ----wasn't aware of the medical issue so I think I will go with your suggestion of bolder colours........................

  5. #5
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117
    I have put the Me.Label279.Visible = Me.NEWPARTcode on the Forms Current event but it has given me an unexpected problem.
    On the form there is a command button which adds a n
    Click image for larger version. 

Name:	SKMBT_36160815160400_0001.jpg 
Views:	20 
Size:	85.5 KB 
ID:	25455
    ew part but when I click this I get a warning message.
    I have attached a screen print .
    The code behind the Add Record is

    Private Sub Command50_Click()
    On Error GoTo Command50_Click_Err

    On Error Resume Next
    DoCmd.GoToRecord , "", acNewRec
    DoCmd.GoToControl "partnumber"
    If (MacroError <> 0) Then
    Beep
    MsgBox MacroError.DESCRIPTION, vbOKOnly, ""
    End If


    Command50_Click_Exit:
    Exit Sub

    Command50_Click_Err:
    MsgBox Error$
    Resume Command50_Click_Exit

    End Sub

    Is there a way around ?

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I'm sorry but my eyes can't read the error message. Would you just type it in a post please?

  7. #7
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117
    Runtime error '94@
    Invalid use of Null

    If I click the "end" button on the warning message I can then simply go to the PARTNUMBER control and type in the new recoird details as normal.......

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Comment out the "On Error Resume Next" line and you should see something useful.

  9. #9
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117
    I have just done that so the code now looks like below.............it doesn't change anything. Still the same error message which I can end and then move to the ADD RECORD control. Have I mis-understood something ?
    '------------------------------------------------------------
    ' Command50_Click
    '
    '------------------------------------------------------------
    Private Sub Command50_Click()
    On Error GoTo Command50_Click_Err

    'On Error Resume Next'
    DoCmd.GoToRecord , "", acNewRec
    DoCmd.GoToControl "partnumber"
    If (MacroError <> 0) Then
    Beep
    MsgBox MacroError.DESCRIPTION, vbOKOnly, ""
    End If


    Command50_Click_Exit:
    Exit Sub

    Command50_Click_Err:
    MsgBox Error$
    Resume Command50_Click_Exit

    End Sub

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    When you attempt to move to a different record for any reason, Access will attempt to save any current record data if the record is "Dirty". Is the record Dirty? Have you changed something?

  11. #11
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117
    To the best of my knowledge, other than the change I have just made with the code for you, nothing else has changed........

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How about a MsgBox showing the value of Dirty? That might tell us something. At this point we do not know where the Null is causing the error and what is Null.

  13. #13
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    to be clear - what is macroerror?

    my understanding is you are running vba code but

    The MacroError object does not contain information about run-time errors that occur when running Visual Basic for Applications (VBA) code.

  14. #14
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117
    I am sorry - I do not understand what you mean with your question......are you looking for me to do something else ?

  15. #15
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117
    I am sorry, I don't understand ......

Page 1 of 4 1234 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. DLookUp Flashing Error
    By RawToast in forum Access
    Replies: 1
    Last Post: 12-16-2014, 09:02 AM
  2. Main page Form flashing button
    By benh in forum Forms
    Replies: 2
    Last Post: 09-19-2014, 05:17 PM
  3. Replies: 6
    Last Post: 12-30-2011, 01:07 PM
  4. Flashing textbox
    By coach32 in forum Forms
    Replies: 1
    Last Post: 11-22-2011, 02:22 AM
  5. subclassing a form to control flashing
    By swt1951swt in forum Forms
    Replies: 0
    Last Post: 07-14-2009, 05:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums