Unanswered: Passing a variable from a form to a report
This is my first time posting, so I hope I'm doing this right.
I'm using VBA in Access 2003 and I have a form, a query and a report. The form is just a combo box with a list of names. The user picks one name which I want the report to use basically as a parameter. So if the name is John Smith, the report will give back dates of speeches and locations of speeches for John Smith. The code looks like this: (It executes when the user presses the OK button on the form)
Private Sub cmdOK_Click()
Dim strWhere As String
If Not IsNull(Me.cmbAttyName) Then
strWhere = Me.cmbAttyName.Value
I put in a message box to see if the form was picking up the value of the attorney name and it is. But when the report runs it is blank. I've checked the spelling, I've checked to make sure the selected attorney actually has records. I've also checked to be sure the field name is correct. The report doesn't error out, it just doesn't do anything. I'm relatively new at this, so please excuse my blundered code. Thanks.