G
Guest
Hello
I am using the following code to try to get a report to show a single record
by clicking a command button in a sub form (perhaps it doesnt work because
its a sub form not a form?) The mainform holds the primary key and subform
displays the data (I also have 2 other sub forms nested in the subform!)
My other complication is that the primary key is a combination of 2 fields,
however, before I even get to this part, when I enter a different field name
in the RunID part of the code which is unique, the report previews, but for
all my records.
So I have 2 problems I guess
1 - Why is it showing all records and not just one?
2 - is there a code that I can borrow for when the RunID needs to be a
primary key made up of 2 fields?
Thanks a lot scripting dudes
Dim strDocName As String
Dim strWhere As String
strDocName = "myreport"
strWhere = "[RunID]=" & Me!RunID
DoCmd.OpenReport strDocName, acPreview, strWhere
I am using the following code to try to get a report to show a single record
by clicking a command button in a sub form (perhaps it doesnt work because
its a sub form not a form?) The mainform holds the primary key and subform
displays the data (I also have 2 other sub forms nested in the subform!)
My other complication is that the primary key is a combination of 2 fields,
however, before I even get to this part, when I enter a different field name
in the RunID part of the code which is unique, the report previews, but for
all my records.
So I have 2 problems I guess
1 - Why is it showing all records and not just one?
2 - is there a code that I can borrow for when the RunID needs to be a
primary key made up of 2 fields?
Thanks a lot scripting dudes
Dim strDocName As String
Dim strWhere As String
strDocName = "myreport"
strWhere = "[RunID]=" & Me!RunID
DoCmd.OpenReport strDocName, acPreview, strWhere