Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Sorry, Label not defined

  2. #17
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    At this point, I am out of suggestions. Really guessing. Suggest you upload a copy of your database for further analysis. Make sure to dummy up any confidential information. Run a compact and repair and then upload.

  3. #18
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    [Click on debug, and run the compile] It's sort of not given me that option (although I have seen it in the past) I followed your instructions, On Error GoTo Err_Command125_Click this part is shaded & I get a compile error -- Label not found
    Sorry, Label not defined

    This is telling you a label cannot be found.

    On Error GoTo Err_Command125_Click this part is shaded & I get a compile error
    This is an error handler - Is says: If there is an error, goto the label named "Err_Command125_Click:". But you do not have that label. (Notice the colon at the end.)

    Your current code (as posted):
    Code:
    Private Sub Command125_Click()    
    On Error GoTo Err_Command125_Click
     
    
        DoCmd.GoToRecord , , acNewRec
        Forms![Customers QuickInfo].CustomerID.SetFocus
    
    Exit_Command125_Click:
        Exit Sub
    
    
    End Sub  (<<-I added this)

    What it should look like:
    Code:
    Private Sub Command125_Click()    
    On Error GoTo Err_Command125_Click
     
    
        DoCmd.GoToRecord , , acNewRec
        Forms![Customers QuickInfo].CustomerID.SetFocus
    
    Exit_Command125_Click:
        Exit Sub
    
    Err_Command125_Click:
       MsgBox Err.Number & ":  " & Err.Description
    
      'optional - can also have
    '   Resume Exit_Command125_Click
    
    End Sub  (<<-I added this)

  4. #19
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    The line

    Resume Exit_Command125_Click

    will jump up to the line

    Exit_Command125_Click:


    This allows you to do clean up things; ie whatever commands follow, until a Exit Sub is found such as: close recordsets, delete records, roll back transactions, ect.


  5. #20
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Steve, Yes! Success!!! Thank you!!! Not to be greedy here but I posted another thread this morning under Forms if you might want to take a peak. I must thank Alan for al of his time & effort. I say this everyday, this forum & you guys are the best!!!!!!!!1

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 10-16-2012, 04:19 PM
  2. Replies: 1
    Last Post: 05-22-2012, 10:46 AM
  3. Replies: 15
    Last Post: 04-06-2012, 10:57 AM
  4. How to start?
    By bergjes in forum Queries
    Replies: 8
    Last Post: 12-28-2011, 11:52 AM
  5. how can i start ?.
    By lavin80 in forum Access
    Replies: 1
    Last Post: 05-23-2009, 11:24 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