code clarification

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 ************************
 
D

Duane Hookom

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.
 
F

firecop1

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 ************************
 
D

Duane Hookom

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 ************************
 

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