G
Guest
Cheryl
I am not sure I understand so let me explain my train of thought
First, the field that links all of the different tables and uniquelly identifies my record is the "ID" field. So, in the code that you gave me I would Replace "CustID" with "ID". What I dont udnerstand is where to place this code. I have a button (that i created with a wizard) on my "Destruction Request" form that opens my "Destruction Request" Report. When i click on the properties for the button I do not see a OpenReport option. Do you mean to place it on the On click option
I am confused.
I really appreciate your help, thank
-Ric
----- Cheryl Fischer wrote: ----
Rich
You will need to add a Where Condition to the OpenReport method so that th
report shows only the information for the record displayed on your form. Fo
example, if the field on your form that uniquely identifies the record i
CustID, you could use it to determine the where condition as follows
Dim strCriteria As Strin
' This works when your CustID field is tex
strCriteria = "[CustID] = " & Chr(34) & Me!CustID & Chr(34
DoCmd.OpenReport "MyReport", acViewPreview, , strCriteri
' This works when your CustID field is a numbe
strCriteria = "[CustID] = " & Me!CustI
DoCmd.OpenReport "MyReport", acViewPreview, , strCriteri
-
Cheryl Fischer, MVP Microsoft Acces
it always goes to the first record in the series of reports. What I woul
like to accomplish is that if I am in the form on record #5 that when
click the Report Preview button that it goes to the correspondin
report(#5)
I am not sure I understand so let me explain my train of thought
First, the field that links all of the different tables and uniquelly identifies my record is the "ID" field. So, in the code that you gave me I would Replace "CustID" with "ID". What I dont udnerstand is where to place this code. I have a button (that i created with a wizard) on my "Destruction Request" form that opens my "Destruction Request" Report. When i click on the properties for the button I do not see a OpenReport option. Do you mean to place it on the On click option
I am confused.
I really appreciate your help, thank
-Ric
----- Cheryl Fischer wrote: ----
Rich
You will need to add a Where Condition to the OpenReport method so that th
report shows only the information for the record displayed on your form. Fo
example, if the field on your form that uniquely identifies the record i
CustID, you could use it to determine the where condition as follows
Dim strCriteria As Strin
' This works when your CustID field is tex
strCriteria = "[CustID] = " & Chr(34) & Me!CustID & Chr(34
DoCmd.OpenReport "MyReport", acViewPreview, , strCriteri
' This works when your CustID field is a numbe
strCriteria = "[CustID] = " & Me!CustI
DoCmd.OpenReport "MyReport", acViewPreview, , strCriteri
-
Cheryl Fischer, MVP Microsoft Acces
regular basis. I have created a report preview button, but when I click itRich said:Hi
I have created a form that, ultimately, fills out a form that I use on
it always goes to the first record in the series of reports. What I woul
like to accomplish is that if I am in the form on record #5 that when
click the Report Preview button that it goes to the correspondin
report(#5)