code clarification

  • Thread starter Thread starter firecop1
  • Start date Start date
F

firecop1

I took the code listed below fro "The Access Web" it was written by Dev
Ashish and I believe it is something I can use however,
I am unsure of what I am supposed to substitute in place of "RunID" to make
it work in my database.

Does it refer to a form name or field name?

Thanks
******************** Code Start ************************
Dim strDocName As String
Dim strWhere As String
strDocName = "rptSomeReport"
strWhere = "[RunID]=" & me!RunID
DoCmd.OpenReport strDocName, acPreview, , strWhere
'******************** Code End ************************
 
RunID is the name of a field in your report that matches the name of a field
in your form. This might be the primary key field of the records your form
is bound to.
 
Ok, I added the field "ID" to my report as it is on my form and it is my
primary key in my table however I am still getting every record in the
report when I click the button...not sure where I am screwing this up.


Duane Hookom said:
RunID is the name of a field in your report that matches the name of a
field in your form. This might be the primary key field of the records
your form is bound to.

--
Duane Hookom
MS Access MVP


firecop1 said:
I took the code listed below fro "The Access Web" it was written by Dev
Ashish and I believe it is something I can use however,
I am unsure of what I am supposed to substitute in place of "RunID" to
make it work in my database.

Does it refer to a form name or field name?

Thanks
******************** Code Start ************************
Dim strDocName As String
Dim strWhere As String
strDocName = "rptSomeReport"
strWhere = "[RunID]=" & me!RunID
DoCmd.OpenReport strDocName, acPreview, , strWhere
'******************** Code End ************************
 
Please show us your exact code...

--
Duane Hookom
MS Access MVP


firecop1 said:
Ok, I added the field "ID" to my report as it is on my form and it is my
primary key in my table however I am still getting every record in the
report when I click the button...not sure where I am screwing this up.


Duane Hookom said:
RunID is the name of a field in your report that matches the name of a
field in your form. This might be the primary key field of the records
your form is bound to.

--
Duane Hookom
MS Access MVP


firecop1 said:
I took the code listed below fro "The Access Web" it was written by Dev
Ashish and I believe it is something I can use however,
I am unsure of what I am supposed to substitute in place of "RunID" to
make it work in my database.

Does it refer to a form name or field name?

Thanks
******************** Code Start ************************
Dim strDocName As String
Dim strWhere As String
strDocName = "rptSomeReport"
strWhere = "[RunID]=" & me!RunID
DoCmd.OpenReport strDocName, acPreview, , strWhere
'******************** Code End ************************
 
Back
Top