Results 1 to 5 of 5
  1. #1
    rjgriffin46 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2014
    Location
    New Jersey
    Posts
    128

    Making a sub-form field value available to a pop-up form

    In my Student Administration database I am trying to launch a popup form from a sub-form of a Job Positions and Seekers form. The sub form is actually one of 2 sub-forms, both Continuous Forms default view, on a form linked via an unbound control (MasterJobPosID).

    The first sub-form is called and lists open Job Positions and the 2nd sub form is called and lists all Students Seeking each of the positions. The Students Seeking subform is linked to the unbound control MasterJobPosID in the main form which is set to equal the Job Positions subform's JobPosRecNo field which is the key to the Job Positions table.


    The popup form is called Job Employment and is being launched via an event macro from the Students Seeking subform. It will allow the user to create a record in the Job Employment table. The event macro has a Where statement that says “=JobPositionID And Student”, an attempt to link it to both the Job Position record being filled and the Student filling it.

    I am able to populate the popup form’s fields in expressions setting Default Values equal to fields on the loaded Job Positions subform and the Student from the Students Seeking subform. What I am unable to get is the Job Position record key from any of the 3 fields it appears in on the Job Positions and Seekers form:


    • MasterJobPosID on the main form.
    • JobPosRecNo on the Job Positions sub form.
    • JobPositionID on the Students Seeking subform.




    I want that to link the new Job employment record to the Job Position record the student is filling. In fact I get a parameter prompt for JobPositionID when the popup form is launched.

    Any suggestions and questions would be welcome.

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Don't understand. If you are creating a new record, why would there be filter criteria?

    Maybe what you want is to pass the JobPositionID and StudentID into fields of the popup form? One way is in popup form Current Event, something like:

    If Me.NewRecord Then
    Me!JobID = Forms!formname!JobID
    Me!StudentID = Forms!formname!StudentID
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    rjgriffin46 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2014
    Location
    New Jersey
    Posts
    128
    I assume you are referring to the macro Where statement in asking why there is filter criteria. It's because I want to record In the new Job Employment record the student filling the position and to fill in fields common to both the position and employment records (eg, job title, wage type, shift). Also, I will want to create an after update event to mark the Job Position record status closed, for which I'd need the Job Position's key field (JobPosRecNo) value.

    I will try your Current Event suggestion. Let me know if you have any further thoughts.

    Thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    WHERE condition will not record data in new record.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    rjgriffin46 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2014
    Location
    New Jersey
    Posts
    128
    I did implement your VBA code and also re entered the Job Position field on the Employment table. Between the two the form now works. Thanks again for your help.

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

Similar Threads

  1. Replies: 3
    Last Post: 08-07-2014, 08:48 AM
  2. Replies: 2
    Last Post: 10-07-2013, 11:01 AM
  3. Replies: 4
    Last Post: 05-29-2013, 01:29 AM
  4. Replies: 1
    Last Post: 12-12-2011, 01:58 PM
  5. Making a Stand Alone Form Available
    By PapaMammoo in forum Forms
    Replies: 1
    Last Post: 01-13-2011, 10:49 AM

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