J
JWCrosby
I have a form with a combo box, based on a query showing the primary key
(StudentKey) and the student’s name. The combo box is bound to the first
column (StudentKey). The combo box is named “Keyâ€. Column widths are 0â€,1â€
I have a command button next to the combo box that I want to open a report
to show only the data for the student selected. The report has the
StudentKey field on it. I’ve tried several coding things with the “on clickâ€
event on the button, but nothing has worked properly. Here’s my latest try
(it generates the error that Access can’t find the field “|†used in the
expression).
Dim stDocName As String
Dim stLinkCriteria As Integer
stDocName = "Billings-AccountHistory"
stLinkCriteria = [StudentKey] = Me![Key]
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
I know it has something to do with how I write the condition statement, but
I haven’t landed on the right way yet.
Thanks in advance.
Jerry
(StudentKey) and the student’s name. The combo box is bound to the first
column (StudentKey). The combo box is named “Keyâ€. Column widths are 0â€,1â€
I have a command button next to the combo box that I want to open a report
to show only the data for the student selected. The report has the
StudentKey field on it. I’ve tried several coding things with the “on clickâ€
event on the button, but nothing has worked properly. Here’s my latest try
(it generates the error that Access can’t find the field “|†used in the
expression).
Dim stDocName As String
Dim stLinkCriteria As Integer
stDocName = "Billings-AccountHistory"
stLinkCriteria = [StudentKey] = Me![Key]
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
I know it has something to do with how I write the condition statement, but
I haven’t landed on the right way yet.
Thanks in advance.
Jerry