Results 1 to 2 of 2
  1. #1
    jtm013 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2014
    Posts
    117

    Problem with subforms

    Hello,



    I've gotten myself stuck. I have a database which tracks information on tooling.
    The main form is called frmToolDetail and stores the basic information about the tooling.
    There is a subform called subCalEvent which is used to input information about every time the tool is calibrated.
    The subform subCalEvent has its own subform called subOCal. This sub has a one to one relationship with the CalEvent form and is only used to store information if the tool is sent out to another company for calibration. So say we have a wrench, if we calibrate the wrench at our company then their will be an entry in SubCalEvent but no entry in subOcal. Now if we sent that wrench to another company for calibration then their would be an entry in both subCalEvent AND in subOCal.

    The problem I have is in trying to pull up past records. On the frmToolDetail there is a button, btnLastCal.
    This button loads subCalEvent to the last calibration event, it SHOULD also load the subOCal to the matching record to the subCalEvent.
    However, when I click this button it will load the last calibration record from subCalEvent, but then loads a blank entry in the subOCal.

    The code for btnLastCal is as follows:

    Code:
    Private Sub btnLastCal_Click()subCalEvent.Visible = True
    
    
    With Me.subCalEvent.Form.RecordsetClone
    If Not .EOF And .BOF Then
    .MoveLast
    Me.subCalEvent.Form.Bookmark = Bookmark
    End If
    End With
    If Me!subCalEvent.Form!chkCalInHouse1.Value = True Then
        With Me!subCalEvent.Form!subEventOCal.Form.RecordsetClone
        If Not .EOF And .BOF Then
        .MoveLast
        Me!subCalEvent.Form!subEventOCal.Form.Bookmark = Bookmark
        End If
        End With
    End If
    
    
    If [bxIR] = 0 Then
        subCalEvent.Locked = False
        Else
            subCalEvent.Locked = True
    End If
    
    
    End Sub
    I assumed since the recordsetclone option works to move the first sub to the last record that it should also move the sub of the sub to the last record, but it is not working.

    Any and all assistance is greatly appreciated!

  2. #2
    jtm013 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2014
    Posts
    117
    Nevermind...I just need more coffee. I had inadvertently set the subOCal's data entry property to yes.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 03-10-2013, 02:36 PM
  2. Data entry problem using subforms
    By Brobin in forum Forms
    Replies: 13
    Last Post: 02-22-2012, 03:26 PM
  3. Forms and Subforms Problem
    By desibabu90 in forum Forms
    Replies: 33
    Last Post: 07-19-2011, 10:48 AM
  4. Problem linking subforms, filtering and uploading
    By sameerk0286 in forum Access
    Replies: 1
    Last Post: 12-09-2010, 09:18 AM
  5. problem with PK and Relatioships in subforms
    By Nokia N93 in forum Access
    Replies: 3
    Last Post: 11-26-2010, 04:00 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