Hi,
I have a form which contains a filename. I need part of this filename to be passed to a query which is viewed in a subform of a separate form when a button is pressed. I have written some code to deal with this, but am getting the error '2448 - you can't assign a value to this object' when I try to run it. Perhaps I need to open the query, assign the criteria, save and close the query, then open the form; but I'm not entirely sure how to do this!
Any advice would be welcome. Al
Code
Private Sub Open_Temp_Report_Click()
'On Error GoTo Err_Open_Temp_Report_Click
Dim Length As Integer
Dim LabID As String
Length = Len(File_Name)
If Length = 9 Then
LabID = "between *" & Mid(File_Name, 3, 3) _
& " AND *" & Right(File_Name, 3)
Else
LabID = "like *" & Mid(File_Check!File_Name, 3, 5) & "*"
End If
DoCmd.OpenForm "QA_Check_View_Report"
Forms!QA_Check_View_Report.CNMT_Temp_Query.Form.[*?CNMT_LBID] = LabID
'QA_Check_View_Report!Lab_ID = LabID
LogUserEvent "Viewed details of temp file" & [File_Name]
'Exit_Open_Temp_Report_Click:
' Exit Sub
'Err_Open_Temp_Report_Click:
' MsgBox Err.Description
' Resume Exit_Open_Temp_Report_Click
End Sub
Display More