Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Location
    Alabama
    Posts
    1

    Unanswered: Auto Fill in Form From Table???

    Hello. Here is what I am trying to do. I have a data base of employees and their training. I have a NEW table called FY2003Training that list training available for FY2003 (Code Number, Session Number, Class type, Location, Start and End Date, etc.) I want to design a form so that I can pull up an employee and select classes from the FY2003 table that will populate the existing training table (data) for the emplyees. In this case a selection of a code and session number define the rest of the data. IE Class Type, Start Date, etc.

    I think I can work the form issue, but do not know how to link (?) data from one table to populate a different table?

    Any easy way...

    I am a novice with access.....

  2. #2
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    You can create a query to pull all the data into one table.
    J.

  3. #3
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    do you mean you want to do something like the screen shot below,
    where the records with the ticks are added to another table?
    if so just create a form that has the table (check box feild needs to be on the source table, or at least i haven't found another method yet) then stick the following code behind the form


    Dim rs As DAO.Recordset

    Private Sub AddRecs_Click() 'add button ' add button
    Set rs = Me.RecordsetClone
    rs.MoveFirst
    While Not rs.EOF
    If rs!Add = True Then DoCmd.RunSQL "INSERT INTO Employees ( EffientNumber, Firstname, Surname) SELECT '" & rs("eff Number") & "', '" & rs("firstname") & "', '" & rs("lastname") & "';"
    rs.MoveNext
    Wend
    form_load
    rs.Close
    End Sub

    Private Sub Exit_Click()
    DoCmd.Close
    End Sub

    Private Sub Form_Load()
    Me.Requery
    End Sub

    Private Sub SelAll_AfterUpdate() 'select all button
    Set rs = Me.RecordsetClone
    rs.MoveFirst
    While Not rs.EOF
    rs.Edit
    rs!Add = SelAll.Value
    rs.Update
    rs.MoveNext
    Wend
    End Sub
    Attached Thumbnails Attached Thumbnails sshot.gif  
    Last edited by m.timoney; 05-07-03 at 10:38.
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •