Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    The OP is using the header of the form to iterate controls. So the possibility of a label is high. Only thing is the OP states it works sometimes and not other times. I did not think labels were in the same group type as acTextBox?

  2. #17
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    that's why I suggested the debug.print ctl.name before trying to do anything with the control. I haven't tested it to know for sure if it's capturing a control it shouldn't even be considering, the debug.print should tell him that rather than guessing as I don't see any code to tell him which control is actually causing the problem.

  3. #18
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    As suggested in my instructions, could make copy and remove confidential data.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #19
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by fainterm View Post

    ...if i have no data in any of the controls, or if i have data in any of the other fields I don't get the error and all fields are cleared. I'm only getting this error if i have any characters in the first control...
    I've set up an identical scenario, including an independent Label in the header, and your code runs perfectly, without problems! Although we usually think of Forms, or even entire Databases, when we speak of corruption, individual Controls can and do become corrupted. The test and the fix are one and the same; deleting the Control then re-creating it! I'd do that to the errant Control, first, and then to the Command Button, if need be.

    Linq ;0)>

  5. #20
    ipisors is offline Access Developer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    119
    Quote Originally Posted by ItsMe View Post
    The OP is using the header of the form to iterate controls. So the possibility of a label is high. Only thing is the OP states it works sometimes and not other times. I did not think labels were in the same group type as acTextBox?
    How is there any possibility of the label, since the code correctly restricts to textboxes and comboboxes?? There isn't ...
    I don't think this has anything to do with labels.

    This is one of those threads where, we can suggest random thoughts all week long, but .... Until the OP learns to do some debugging by onesself, it's basically just shooting darts in the dark.

  6. #21
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by ipisors View Post
    How is there any possibility of the label...
    I don't know. Post 16 was in response to post 15

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

Similar Threads

  1. Replies: 2
    Last Post: 08-03-2013, 03:41 PM
  2. Replies: 3
    Last Post: 05-16-2012, 10:20 AM
  3. How to create a clear button
    By tomneedshelp in forum Access
    Replies: 1
    Last Post: 05-10-2012, 05:21 AM
  4. Command button code to clear form
    By windwardmi in forum Forms
    Replies: 15
    Last Post: 11-21-2010, 03:21 PM
  5. Search and Clear button
    By polk383 in forum Programming
    Replies: 1
    Last Post: 08-30-2006, 08:51 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