Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25
  1. #16
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    Now it says that .....Item not found in this collection

    Dim rstEditGrower_Record As Recordset
    Set rstEditGrower_Record = Forms!frm_EDIT_CURRENT_FULLGROWER.RecordsetClone


    rstEditGrower_Record.MoveFirst
    Do While Not rstEditGrower_Record.EOF
    For Each ctl In Screen.ActiveForm.Controls
    If ctl.Tag = "Audit" Then
    If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Or ctl.ControlType = acCheckBox Then

    If Nz(ctl.Value) <> Nz(rstEditGrower_Record(ctl.ControlSource)) Then.....this line errors with item not found in this collection.............


    CementCarver

  2. #17
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Can you post the db here, or a representative sample?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #18
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    Can I send it to you privately? I'll first need to strip out all the confidential info.

    CC

  4. #19
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Sure, you can send it to

    pbaldy
    gmail
    com
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #20
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    thank you very much..... you'll have it shortly.

    CC

  6. #21
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If you set a breakpoint and step through it, the code actually works for a few passes. If fails when it gets to the control source of:

    FULLGROWER.District

    It appears that the recordset only contains a field named District.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #22
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    Thanks PBaldy for looking at my code. I will try to replicate what you've found and change the control name.

    You didn't have any problems with the Active_InActive checkbox?

    CementCarver

  8. #23
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Doesn't look like it. I got entries in the audit table for it. I added a couple of lines:

    Debug.Print "Control Name = " & ctl.Name
    Debug.Print "Value is = " & ctl.Value
    Debug.Print "Control source is: " & ctl.ControlSource
    Debug.Print "Old Value is: " & rstEditGrower_Record(ctl.ControlSource)

    And the results were:

    Control Name = GoingAndNotGoing
    Value is = 0
    Control source is: Active_InActive
    Old Value is: False
    Control Name = Out_of_Business
    Value is = -1
    Control source is: Out_of_Business
    Old Value is: False
    Control Name = District
    Value is = 1
    Control source is: FULLGROWER.District

    so it blew up on the third control it checked.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #24
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    That's weird. It never got past the Active_InActive checkbox...?? I'm correcting each control it's complaining on and am moving forward.

    Thank you sooooo much for your review.

    CementCarver

  10. #25
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problemo, good luck with the project.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Comparison Inconsistency
    By topcat39 in forum Queries
    Replies: 2
    Last Post: 06-22-2013, 12:23 PM
  2. Comparison
    By raytackettsells in forum Queries
    Replies: 2
    Last Post: 08-06-2012, 05:30 PM
  3. Number comparison help
    By kgriff in forum Access
    Replies: 13
    Last Post: 02-17-2012, 07:41 PM
  4. VBA problem with IF comparison. HELP.
    By spkoest in forum Programming
    Replies: 6
    Last Post: 05-04-2011, 03:29 AM
  5. Comparison
    By VICTOR HUGO in forum Access
    Replies: 8
    Last Post: 02-10-2010, 04:32 PM

Tags for this Thread

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