Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2011

    Question Unanswered: Trying to make a form for Sub Record

    My database is a personnel tracker for a military unit. Without getting into specifics, I'm trying to make a form to log parachute jumps for the individuals assigned to my unit.

    I have a table "tblMain" that has all the records for the soldiers (identified by their social security number, SSN) and a table "tblJUMPLOG" that *hopefull* will store each soldiers jumps.

    I attached a dummy example.

    What I can't get to happen is to create a form to add a jump (each jump will consist of info in each field that is on tblJUMPLOG) that will be a sub-record of a soldier on tblMAIN.

    The endstate of this is to be able to log every jump (...there are a ton) for each soldier in my database and create a report that displays every jump they've completed, sorted by name.

    Please any help is greatly appreciated
    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2011

    multiple soldiers on the same jump

    I forgot to mention; if there is a way to log several soldiers on the same jump that would be ideal. When we jump it's usually several dozen soldiers jumping at once, not just one.

  3. #3
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    If you're speaking of
    • Opening Access
    • Entering a jump for one trooper in the Subform
    • Moving to another trooper (in the Main Form)
    • Going into the Subform and entering the same jump data

    you can use the AfterUpdate event of the Control holding your data to set the DefaultValue for the Field. From that time forward, until you either manually change the data or close your form, the data will be entered automatically in each New Record.

    So, you'd need to
    1. Create a Main Form to hold the 'trooper's' data from the tblMain Table
    2. Create a Form to hold the 'jump' data from the tblJUMPLOG Table
    3. In Design View for the Main Form, place a Subform Control
    4. When the Subform Wizard pops up, select the tblJUMPLOG Form, and select the SSN field to link the Main Form/Subform.

    Now, open the tblJUMPLOG Form in Design View, and for each Control whose 'jump' data you want to carry forward

    Private Sub YourControlName_AfterUpdate()
       Me.YourControlName.DefaultValue = """" & Me.YourControlName.Value & """"
    End Sub
    Remember, you’ll need to do this for each Control that you want to ‘carry forward.’

    Note that this code/syntax can be used for any Datatype.

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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