Linking results to new forms

  • Thread starter Thread starter SmoothMasterZ
  • Start date Start date
S

SmoothMasterZ

I've been working on this for about a month... but i've hit a wall...

I've set up a form (Mainform) that will display information gleaned
from a query (Mainquery) on a database. One piece of information
Mainform pulls from the query is a log of activity, which is placed in
a subform (SubMainform). When SubMainform is double-clicked, the log is
placed in a new form that pops up (logform). My question to you, oh
learned ones of the forums, is how do I limit the information displayed
in logform so the information displayed in logform is from the same
record as Mainform? Currently, when logform pops up, it displays all
the logs for all the records from Mainform.
If I've been vauge or omited any information needed, let me know and
i'll be happy to clarify as best I can


Regards,
Michael Zettler
 
(e-mail address removed) wrote:
<snip>
Currently, when logform pops up, it displays all
the logs for all the records from Mainform.
</snip>

sounds like you need to pass a filter in the open event of your popup.
You should be able to do this with the button wizard.

Form Operations, Open Form, <next>, Select the Logform,<next>, select
specific data, select the matching fields, select the text/picture for
the button, click done.

this is the code the wizard builds...

Private Sub cmdOpenChildrenForm_Click()
On Error GoTo Err_cmdOpenChildrenForm_Click

Dim stDocName As String
Dim stLinkCriteria As String

'open what form?
stDocName = "frmChildren"

'show which records?
stLinkCriteria = "[FEmployeeID]=" & Me![EmployeeID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdOpenChildrenForm_Click:
Exit Sub

Err_cmdOpenChildrenForm_Click:
MsgBox Err.Description
Resume Exit_cmdOpenChildrenForm_Click

End Sub
 
Back
Top