The other day my database started having some problems. I have two copies. One on the server that only gets changed when I have a fair amount of updates to be added to that copy. I also have a copy on my desk top that I tinker with. They both have the same back end. The problem is that the one on the server threw an error 3061 too few parameters. Expected 1. Now this is code that I have been using several months if not longer. I haven't had one problem with it until last Friday. I started to try and figure out where the error was occurring and traced it to a specific line on my copy on my desk top. So I have two files that suddenly started generating problems at the same time. That is a little weird to me. That being said, the problem is that I am trying to open a recordset (instead of multiple Dlookups) to get the information I need from a query. When I run the query while the form is open, it does return the information I am looking for. Thusly, when I do debug.print and do a dlookup, I also get a desired return in the immediate window. What I don't get is why then do I get too few parameters when clearly, there are parameters. Here is the code below. Any advice would be appreciated.
Code:
Dim FSO As Object
Dim ToPath As String
Dim FolderName As String
Dim FromPath As String
Dim TRNYear As String
Dim Destination As String
Dim Hyper As String
Dim ToPathCheck As String
Dim MsgStr As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
FolderName = Me.TRNumberCombo.Column(1)
TRNYear = Left(FolderName, 4)
Set db = CurrentDb
Debug.Print DLookup("InitialServerDestination", "TestLocationQuery")
Set rs = db.OpenRecordset("TestLocationQuery")
rs.MoveFirst
FromPath = rs!InitialServerDestination & FolderName
Destination = rs!CompletedServerDestination
ToPath = rs!CompletedServerDestination & "\" & TRNYear & "\" & FolderName
rs.Close
Following code .....
End Sub