
На данный момент, у меня не показывается Report если есть в нем поля, которые я не хотела вытаскивать, и таким образом они оказались не найдены Report-ом . Помогите мне пожалуйста с этой проблемой.
Вот часть кода:
*** FORM 1 ***************************************************
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Private Sub Command2_Click()
F2.Show
End Sub
*************************************************************************************************
*** FORM 2 ***************************************************
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim lastSQL As String
Dim fromSql As String
Dim psikSql As String
Dim flag As Boolean
Public Sub Init()
lastSQL = "select "
fromSql = " from "
psikSql = ","
End Sub
Private Sub Psik()
If Not (flag) Then
flag = True
Init
Else
lastSQL = lastSQL & psikSql
End If
End Sub
Private Sub Check1_Click()
Dim sqlLastName As String
DReport1.Sections("Section1").Controls("Label3").Visible = True
DReport1.Sections("Section1").Controls("Text2").Visible = True
Psik
sqlLastName = " Pratim_ishim.Last_name"
lastSQL = lastSQL & sqlLastName
End Sub
Private Sub Check2_Click()
Dim sqlFirstName As String
DReport1.Sections("Section1").Controls("Label2").Visible = True
DReport1.Sections("Section1").Controls("Text1").Visible = True
Psik
sqlFirstName = " Pratim_ishim.First_name"
lastSQL = lastSQL & sqlFirstName
End Sub
Private Sub Sium()
End Sub
'*********************************************************************
'*********************************************************************
Private Sub Form_Load()
Set cn = New ADODB.Connection
cn.Open "dsn=PROJECT"
End Sub
Private Sub Command1_Click()
'Dim strSQL As String
'strSQL = "select Pratim_ishim.First_name, Pratim_ishim.Last_name From Pratim_ishim Where First_name ='olga'"
lastSQL = lastSQL & fromSql
lastSQL = lastSQL & " Pratim_ishim"
MsgBox lastSQL, vbInformation, Me.Caption
Set rs = cn.Execute(lastSQL)
MsgBox "nabor sformirovan.", vbInformation, Me.Caption
Dim strAuthor As String
Set DReport1.DataSource = rs
DReport1.Sections("Section3").Controls("Label4").Caption = strAuthor
DReport1.Show
lastSQL = ""
End Sub
Private Sub Form_Unload(Cancel As Integer)
rs.Close
cn.Close
End Sub
***********************************************************************************************
******** DATA REPORT ******************************************************************
---- Report Header (Section4)---------------------------------------------------------
[отчёт] ( - это RptLable)
---- Page Header (Section2)-----------------------------------------------------------
---- Detail (Section1)----------------------------------------------------------------------
[First name] ( - это RptLable) [First_name] ( - это RptTextBox) [Last name] ( - это RptLable) [Last_name] ( - это RptTextBox)
---- Page Footer (Section3)------------------------------------------------------------
[ страница %p из %P ] ( - это RptLable)
---- Report Footer (Section5)----------------------------------------------------------
[всего:] ( - это RptLable) [RCNT] ( - это RptFunction)
*********************************************************************************************************************************************