I am trying to compile my VBA code in Access 2010, however, I keep getting this error: Sub or Function not defined. When I click OK, it highlights the following code:
I know that the spelling is correct because I used the inteliSense prompt to finish the typing for me. I tried renaming the control, same problem (after I renamed the control reference of course). I tried referencing it with the long reference through the form like this:
The error that I get then highlights the .Controls. Further up the form's code module, I have a reference to the same textbox and it doesn't have a problem with it. I discovered it because when I renamed the control and tried to compile the database, it then caught it. Once I fixed the name, it worked and then went back down to this same problem line. I have compacted and repaired the database. I have rebooted my computer. I tried removing my reference to the Microsoft Office xx.x Object Library that I had added and still nothing (I didn't think that it would, but I had to try). I don't know what else to do at this point. Any ideas?
Code:
Me.txtFileLoc 'Full code line If Me.txtFileLoc & "" <> "" And FileExists(Me.txtFileLoc) Then
Code:
Forms("frmFileImport").Controls("txtFileLoc")
Comment