S
Sash
I am currently creating a recordset as follows:
strSQL = "SELECT * from CHospital ORDER BY ID"
Set rs = db.OpenRecordset(strSQL, dbOpenDynaset, dbSeeChanges)
Close #1
Open "u:\interfaces\uif\" & Format(Time, "HHMMSS") & "_" & strOrigFile
For Output As #1
strClientNum = Right(rs.Fields("ClientCode"), 3)
I then have a program that takes the recordset and I create a file
containing a file header row with client information, a header row with
patient identifier and detailed patient information on the lines following.
I loop through creating a separate header row for each patient.
I just received and will be receiving in the future a file with two clients
in the same file. I'm wondering the best way around this.
I had thought about adding and if statement, but it seems to clumsy.
If strClient = strClient then
**do everything**
Else
Close the output file, open a new output and proceed
Maybe a loop until strClient <> strClient
then close the outputfile and open a new output and proceed
Here's the file header code and any suggestions would be appreciated.
'************* FH - FILE HEADER **************************
Dim FH As String
FH = "FH" & Chr(9) & Date & Chr(9) & Time() & Chr(9) & strClient &
Chr(9) & "0"
Print #1, FH
rs.MoveFirst
Do While Not rs.EOF
On Error Resume Next
** this is followed by the Header Row with Patient data and many other
segments**
strSQL = "SELECT * from CHospital ORDER BY ID"
Set rs = db.OpenRecordset(strSQL, dbOpenDynaset, dbSeeChanges)
Close #1
Open "u:\interfaces\uif\" & Format(Time, "HHMMSS") & "_" & strOrigFile
For Output As #1
strClientNum = Right(rs.Fields("ClientCode"), 3)
I then have a program that takes the recordset and I create a file
containing a file header row with client information, a header row with
patient identifier and detailed patient information on the lines following.
I loop through creating a separate header row for each patient.
I just received and will be receiving in the future a file with two clients
in the same file. I'm wondering the best way around this.
I had thought about adding and if statement, but it seems to clumsy.
If strClient = strClient then
**do everything**
Else
Close the output file, open a new output and proceed
Maybe a loop until strClient <> strClient
then close the outputfile and open a new output and proceed
Here's the file header code and any suggestions would be appreciated.
'************* FH - FILE HEADER **************************
Dim FH As String
FH = "FH" & Chr(9) & Date & Chr(9) & Time() & Chr(9) & strClient &
Chr(9) & "0"
Print #1, FH
rs.MoveFirst
Do While Not rs.EOF
On Error Resume Next
** this is followed by the Header Row with Patient data and many other
segments**