J
Jacob Frankham
Hi everyone
The scenario is this:
A team of inspectors will inspect colleges/universities for quality of
provision etc, and the results of these inspections will be recorded in a
Lotus Notes database.
An inspector will be unlikely to check ALL of the courses that a college
runs, so the specific courses that (s)he has checked will also be recorded
in the database.
I am importing this data into access - (thats the easy bit !)
Lotus Notes automatically gives each record a unique ID number (long mix of
numbers and text)
I am trying to create a report which shows for each college/university all
of the programmes inspected within that inspection. There will be many
instances of an inspection at each college/university, and are all likely to
have different programmes checked within them.
So, I have a query which lists (amongst other data)
docID (identifies each inspection)
name (of the college / university)
programme (lists the different programmes checked during that particular
inspection)
date etc
eg
a1ssq2 Sheffield College ..... ..... BSc 11.08.99
a1ssq2 Sheffield College ..... ..... LLB 11.08.99
a1ssq2 Sheffield College ..... ..... BA
11.08.99
.......... ............................ ..... .....
....... .............
d3lgt4 Edinburgh University ..... ..... BEng 04.05.02
d3lgt4 Edinburgh University ..... ..... MSc 04.05.02
d3lgt4 Edinburgh University ..... ..... BSc 04.05.02
d3lgt4 Edinburgh University ..... ..... LLB 04.05.02
OK so here is my question !!! -
For each college / university, I wish to display all of the programmes which
were inspected on that date.
I need the programmes to be listed ON ONE LINE, (separated by commas).
I currently have a textbox field and am using some VBA to iterate through a
recordset to display the programmes but this is taking too much time when
the report opens - I was thinking of using a hidden textbox field and
iterating through that instead, I guess that would be quicker at runtime?
A copy of the VBA I am currently using is below
Public Function FillControl()
txt_Provision = ""
Dim db As Database
Dim rstTemp As Recordset
Set db = CurrentDb
Set rstTemp = db.OpenRecordset("sqry_AuditedProvisions", dbOpenDynaset)
Dim F1 As Field
Dim F2 As Field
Dim F3 As Field
Set F1 = rstTemp("provision")
Set F2 = rstTemp("docID")
Dim FillString As String
With rstTemp
Do While Not rstTemp.EOF
If F2 = [txt_docID] Then
FillString = FillString & F1 & ", "
End If
.MoveNext
Loop
End With
FillControl = Left(FillString, IIf(Len(FillString) > 0, Len(FillString) - 3,
FillString))
rstTemp.Close
Set db = Nothing
End Function
But, as I said it is taking far too long at runtime using this method, so I
need an alternative
Hope this is somewhat clear?
Cheers
Jake
The scenario is this:
A team of inspectors will inspect colleges/universities for quality of
provision etc, and the results of these inspections will be recorded in a
Lotus Notes database.
An inspector will be unlikely to check ALL of the courses that a college
runs, so the specific courses that (s)he has checked will also be recorded
in the database.
I am importing this data into access - (thats the easy bit !)
Lotus Notes automatically gives each record a unique ID number (long mix of
numbers and text)
I am trying to create a report which shows for each college/university all
of the programmes inspected within that inspection. There will be many
instances of an inspection at each college/university, and are all likely to
have different programmes checked within them.
So, I have a query which lists (amongst other data)
docID (identifies each inspection)
name (of the college / university)
programme (lists the different programmes checked during that particular
inspection)
date etc
eg
a1ssq2 Sheffield College ..... ..... BSc 11.08.99
a1ssq2 Sheffield College ..... ..... LLB 11.08.99
a1ssq2 Sheffield College ..... ..... BA
11.08.99
.......... ............................ ..... .....
....... .............
d3lgt4 Edinburgh University ..... ..... BEng 04.05.02
d3lgt4 Edinburgh University ..... ..... MSc 04.05.02
d3lgt4 Edinburgh University ..... ..... BSc 04.05.02
d3lgt4 Edinburgh University ..... ..... LLB 04.05.02
OK so here is my question !!! -
For each college / university, I wish to display all of the programmes which
were inspected on that date.
I need the programmes to be listed ON ONE LINE, (separated by commas).
I currently have a textbox field and am using some VBA to iterate through a
recordset to display the programmes but this is taking too much time when
the report opens - I was thinking of using a hidden textbox field and
iterating through that instead, I guess that would be quicker at runtime?
A copy of the VBA I am currently using is below
Public Function FillControl()
txt_Provision = ""
Dim db As Database
Dim rstTemp As Recordset
Set db = CurrentDb
Set rstTemp = db.OpenRecordset("sqry_AuditedProvisions", dbOpenDynaset)
Dim F1 As Field
Dim F2 As Field
Dim F3 As Field
Set F1 = rstTemp("provision")
Set F2 = rstTemp("docID")
Dim FillString As String
With rstTemp
Do While Not rstTemp.EOF
If F2 = [txt_docID] Then
FillString = FillString & F1 & ", "
End If
.MoveNext
Loop
End With
FillControl = Left(FillString, IIf(Len(FillString) > 0, Len(FillString) - 3,
FillString))
rstTemp.Close
Set db = Nothing
End Function
But, as I said it is taking far too long at runtime using this method, so I
need an alternative
Hope this is somewhat clear?
Cheers
Jake