Bronte1226
Technical User
I am trying to change some code in a report that was made before I took over my position. The report has a parameter box that opens and runs a query to open the report based on the entry given in the message Box. I need to change this to run the report based on the current record instead of going through the message box. I have tried to change this myself but seem to keep missing a step that makes the report error out. Below is the code for the open event for the report. I hope someone can help!
Private Sub Report_Open(Cancel As Integer)
Dim strPointVar As String
Dim strPointID As String
strPointID = InputBox("Enter point in box below!", "Please Enter Control Point ID..."
If strPointID = "" Then
Cancel = True
End If
Dim query, arg
arg = strPointID
query = "SELECT * from tblMboroControlNetwork WHERE tblMboroControlNetwork.[pointid] = '" & arg & "'"
Me.RecordSource = query
End Sub
Private Sub Report_Open(Cancel As Integer)
Dim strPointVar As String
Dim strPointID As String
strPointID = InputBox("Enter point in box below!", "Please Enter Control Point ID..."
If strPointID = "" Then
Cancel = True
End If
Dim query, arg
arg = strPointID
query = "SELECT * from tblMboroControlNetwork WHERE tblMboroControlNetwork.[pointid] = '" & arg & "'"
Me.RecordSource = query
End Sub