I have the following code from a database that is using a reference to a form with Forms():
As you can see, the form name and control are set earlier.
The problem is that the form name is set with Me.Name and the ControlName is named (like "txtFilesFound").
The problem is that I am trying to use this form in an unbound subform so that I can simplify the interface and load the unbound subform based on the links on the left clicked.
But any attempt to substitute Me.Name with Frm_MainPage!ubSubForm (are any variant) fails with "Can't find the Form".
How would I change this to allow the reference into the subform?
Thanks. Sean.
Code:
CurrentDb.Execute " INSERT INTO tblFilesFound" & _
" (" & _
" FilePath," & _
" FileName" & _
" )" & _
" SELECT " & _
Chr$(34) & strFilePath & Chr$(34) & " AS FilePath," & _
Chr$(34) & strFileName & Chr$(34) & " AS FileName"
Forms(strUpdateFormName)(strUpdateControlName) = strFileName
DoEvents
As you can see, the form name and control are set earlier.
The problem is that the form name is set with Me.Name and the ControlName is named (like "txtFilesFound").
The problem is that I am trying to use this form in an unbound subform so that I can simplify the interface and load the unbound subform based on the links on the left clicked.
But any attempt to substitute Me.Name with Frm_MainPage!ubSubForm (are any variant) fails with "Can't find the Form".
How would I change this to allow the reference into the subform?
Thanks. Sean.