Private Sub Command1_Click()
Dim strsql As String
If Option1.Value = True Then
Set rs = New Recordset
strsql = "SELECT [Progress Notes].[Patient ID], [Progress Notes].time, [Progress Notes].DatePN, [Progress Notes].Diagnosis, [Progress Notes].[Progress Notes], [Progress Notes].PNSHEET, [Patient Personal Information].Name, [Patient Personal Information].[Maiden Name], [Patient Personal Information].Surname, [Patient Personal Information].Sex, [Patient Personal Information].Age FROM [Patient Personal Information] INNER JOIN ([Patient Medical Profile] INNER JOIN ([Patient Family History] INNER JOIN [Progress Notes] ON [Patient Family History].[Patient ID] = [Progress Notes].[Patient ID]) ON [Patient Medical Profile].[Patient ID] = [Patient Family History].[Patient ID]) ON [Patient Personal Information].[Patient ID] = [Patient Medical Profile].[Patient ID] where [progress notes].[patient id]='" & txtptid.Text & "'"
With rs
.ActiveConnection = db
.CursorLocation = adUseClient
.Open strsql, db, adOpenStatic, adLockOptimistic
End With
With RptPatientPrognotes
Set .DataSource = rs
.DataMember = ""
With .Sections("Section2").Controls
.Item("txtname").DataField = rs("name").Name
.Item("txtptid").DataField = rs("patient id").Name
.Item("txtmaiden").DataField = rs("maiden name").Name
.Item("txtsurname").DataField = rs("surname").Name
.Item("txtage").DataField = rs("age").Name
.Item("txtsex").DataField = rs("sex").Name
End With
With .Sections("Section1").Controls
.Item("txtdate").DataField = rs("datepn").Name
.Item("txtdiag").DataField = rs("diagnosis").Name
.Item("txtnotes").DataField = rs("progress notes").Name
End With
.Refresh
.Show
End With
End If
Set RptPatientPrognotes.DataSource = rs
RptPatientPrognotes.Show
End Sub
when i debug it, it focus on the .refresh.
error:
run-time error '8551';
Control 'txtname' cannot be placed on this section.
Would you please send it in a zip file..
then there may be a chance for knowing the exact pro.
there are many propublities..
i think you have to put this in the starting
Load RptPatientPrognotes
OR
Execute it like this
With .Sections("Section2")
.Controls("txtname").DataField = rs("name").Name
.Controls("txtptid").DataField = rs("patient id").Name
.Controls("txtmaiden").DataField = rs("maiden name").Name
.Controls("txtsurname").DataField = rs("surname").Name
.Controls("txtage").DataField = rs("age").Name
.Controls("txtsex").DataField = rs("sex").Name
End With
Last edited by mohdk_bh; Sep 6th, 2003 at 09:15 AM.
I'ts not so much where you stand in life, but in what direction you are moving
aha.. so now every thig related to the design is correct
but the way it's connected to the data souce is not..
so you have two solution
one is:
it's better to remove the group header/footer.. and put the patients informtion up in the report or page header,, the send the information with this manual code: