Is the dB split?
If yes, is the path to the BE identical?
If no, did you relink the FE to the BE?
I modified your code = I added or changed lines in BLUE
Code:
Function Wrap_Detail()
'CallingRoutine As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String
Dim WF As Integer
Set db = CurrentDb
WF = FreeFile 'get the next free handle
If CallingRoutine = 1 Then
strSQL = "Select * From [Community_Detail1]"
Close #WF '<<--- don't really need this line
'Open the Text file for writing.
strFileName = "CityDetail.txt"
' Open "\\Server\shared$\Information Technology\NAS ITDept\" & strFileName For Output As #1
Open "\\Server\shared$\Information Technology\NAS ITDept\" & strFileName For Output As #WF 'write to file
ElseIf CallingRoutine = 2 Then
strSQL = "Select * From [Community_Detail2]"
Close #WF '<<--- don't really need this line
'Open the Text file for writing.
strFileName = "CityDetail.txt"
Open "\\Server\shared$\Information Technology\NAS ITDept\" & strFileName For Output As #WF
End If
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
With rs
If .RecordCount = 0 Then
Print #WF, "Record Count = " & rs.RecordCount
Else
Print #WF, "Record Count = " & rs.RecordCount
End If
End With
With rs
Do While Not rs.EOF
Print #WF, rs.Fields(0)
rs.MoveNext '<<<---- necessary in recordset loops
Loop
End With
rs.Close 'close recordset
Close #WF 'Close text file.
Set rs = Nothing
Set db = Nothing
End Function