Thank you for responding, John.
My first form shows Proposal information. I have many proposals and all of
them do not turn into projects. I want to open the subform Projects by using
a button to enter the data for the project but I only want it to return
records for that Proposal. For example, Proposal No. P08003, I want to show
Project No. 08003 only.
Then you'll need a Command button to open the form. It will need code to pull
the proposal number from the calling form, parse it into a project number (by
trimming off the first letter? is the Project number also a text field?) and
passing it to the called form. Untested air code:
Private Sub cmdOpenProject_Click()
Dim strProjno As String
strProjno = Mid(Me![ProposalNo], 2) ' extract 2nd-end of string
DoCmd.OpenForm "frmProjects", _
WhereCondition := "[ProjectNo] = '" & strProjNo & "'", _
OpenArgs := strProjNo
End Sub
The in the Project form's Open event put code like
Private Sub Form_Open(Cancel as Integer)
Me!ProjectNo.DefaultValue = Chr(34) & Me.OpenArgs & Chr(34)
End Sub
This will set the default value of ProjectNo to
"08003"
with the quotes, so new records will inherit the desired value.