Page 3 of 3 FirstFirst 123
Results 31 to 35 of 35
  1. #31
    PinkLady50 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2017
    Posts
    171
    added from lstCAR # 3, 6
    added from lstCAR # 4, 7
    Key is 450


    added from lstCAR # 1, 2
    added from lstCAR # 2, 4
    added from lstCAR # 3, 5
    added from lstCAR # 4, 6
    added from lstCAR # 5, 7

  2. #32
    PinkLady50 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2017
    Posts
    171
    So this is this Problem-Record for 450
    It writes item 2 from Listbox then writes the NonconformanceRecordID 450
    Then it write the other records.
    Attached Thumbnails Attached Thumbnails ProblemRecord 3-21.PNG  

  3. #33
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    Code:
    Set dbs = CurrentDb
          Set rst = dbs.OpenRecordset("Problem_record") 'Form Recordsource = Nonconformance_Record tbl
          If Me.Dirty Then Me.Dirty = False   'force record save
        Debug.Print "Key is " & Me.nonconformance_record_NonconformanceRecordID
        
        'Loop through the ItemsSelected in the list box.
        With Me.lstCAR
            'here we are getting the Problemid of the selected Items '*********************************
          For Each varItem In .ItemsSelected
              If Not IsNull(varItem) Then
                  rst.AddNew
                  recCnt = recCnt + 1
                  rst!ProblemID = lstCAR.ItemData(varItem)
                  rst!NonconformanceRecordID = Me.nonconformance_record_NonconformanceRecordID
    
                  debug.print "added from lstCAR # " & reccnt & ", " &  lstCAR.itemdata(varItem) 
                  
                   rst.Update
                End If
                 
            Next
       End With
    Gotta put that key into the update...

  4. #34
    PinkLady50 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2017
    Posts
    171
    Davegri

    SUCCESS!!!! Thank you for your patience in helping me get this completed. I have learned a great deal from you. My management has agreed to finally get me some training!!

  5. #35
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    Happy ending. Good luck in your career!

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Time doesn't add up correctly
    By Larryg in forum Reports
    Replies: 2
    Last Post: 09-03-2015, 11:41 PM
  2. Listbox won't display time correctly
    By UserX in forum Access
    Replies: 7
    Last Post: 06-26-2014, 05:39 PM
  3. Run Time Errors
    By Stephanie53 in forum Access
    Replies: 7
    Last Post: 03-27-2013, 07:48 AM
  4. Replies: 4
    Last Post: 10-07-2011, 10:58 AM
  5. Replies: 11
    Last Post: 03-16-2006, 12:28 PM

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