M
Mabeline
I have created a form that is linked to a table (named Report Table) and the
form (named Select Records) only has one field (unbound text box named Find
Records) where the user enters a tag number (text field in the table) and the
form then is supposed to retrieve all the records in the table that equal the
tag number. It then displays the records in a report which maximizes on the
screen. The code below works but brings all of the records from the table and
not just the ones that equal the inputted tag number. Can anyone show me what
I am doing wrong in this code. I don't know much about this type of code.
Thanks in advance.
Private Sub Find_Records_AfterUpdate()
Dim stDocName As String
Dim strcriteria As String
strcriteria = "Tag Number Like '" & [Find Records] & "'"
strDocName = "Report Table"
DoCmd.OpenReport strDocName, acPreview, strcriteria
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End Sub
Mabeline
form (named Select Records) only has one field (unbound text box named Find
Records) where the user enters a tag number (text field in the table) and the
form then is supposed to retrieve all the records in the table that equal the
tag number. It then displays the records in a report which maximizes on the
screen. The code below works but brings all of the records from the table and
not just the ones that equal the inputted tag number. Can anyone show me what
I am doing wrong in this code. I don't know much about this type of code.
Thanks in advance.
Private Sub Find_Records_AfterUpdate()
Dim stDocName As String
Dim strcriteria As String
strcriteria = "Tag Number Like '" & [Find Records] & "'"
strDocName = "Report Table"
DoCmd.OpenReport strDocName, acPreview, strcriteria
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End Sub
Mabeline