Records to show

I

Ivor Williams

I have two forms, one of which I want to function as a "subform". On the
first form is a command button which, when clicked opens the second form.
The second form is based on a query. In the query, the criteria in the
ProjectNumber field is set to be equal to the ProjectNumber on the first
form. The second forms default view is set to Continuous Forms. I have a
number of entries for one ProjectNumber, but when I open the second form,
only a new record is displayed. I would like to be able to view all the
records for that ProjectNumber when the second form is opened. How can I do
this?

Ivor
 
G

Guest

Ivor,

It sounds like you might have the Data Entry property of your subform set to
"Yes". Go the properties of the second form, click the "Data" tab, then see
what's on the Data Entry line.

HTH

Aaron G
Philadelphia, PA
 
I

Ivor Williams

I checked that. It is set to "No".
Aaron G said:
Ivor,

It sounds like you might have the Data Entry property of your subform set
to
"Yes". Go the properties of the second form, click the "Data" tab, then
see
what's on the Data Entry line.

HTH

Aaron G
Philadelphia, PA
 
G

Guest

Ivor,

When you say you want the second form to be a "subform", do you mean that
you want it embedded within the main form, or do you mean that you have the
second form as a stand alone popup?

Also, please post the code you use on your command button to open the second
form.

Aaron G
Philadelphia, PA
 
I

Ivor Williams

Aaron...

The second form is a stand alone popup. The code used to open the second
form is below.

Ivor

Private Sub cmdProjStatus_Click()
On Error GoTo Err_cmdProjStatus_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmStatusCalls"

stLinkCriteria = "[ProjNo]=" & "'" & Me![ProjName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdProjStatus_Click:
Exit Sub

Err_cmdProjStatus_Click:
MsgBox Err.Description
Resume Exit_cmdProjStatus_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top