show a data report with condition
I made data report with condition. I want to input a student id number in a text box and press a button to show all data of this student, but a problem when i input a number in the text box (and press the button) for show the report a msg show.
Run time error 2147217887(80040e21)
[micorsoft][ODBC microsoft access driver] optional feature not implemented.
i write code in the button:
Load DataEnvironment2
With DataEnvironment2
If .rsCommand1.State <> 0 Then .rsCommand1.Close
.Command1 Text2.Text
End With
DataReport2.Show
what problem ? Please help me
Re: show a data report with condition
Re: show a data report with condition
Thread moved to Reporting forum
Re: show a data report with condition
Did you setup a parameter in the dataenvironment? This is how I use parameters with a DE.
Code:
de1.Commands("rsCommand1").Parameters("param1").Value = txtText1.Text
Re: show a data report with condition
please modify my code with your suggestion. and post it.
Re: show a data report with condition
I would have to see your dataenvironment. What don't you understand?
Re: show a data report with condition
I write code in sql :
Select * From table1 Where Student_ID = ?
and use parametres "data type = adbigint" & "Host data type = Long(vt_I4)"
Re: show a data report with condition
What is the problem? Just a guess, try setting "data type = adVariant". What is the parameter name and how do you assign a value to it?
Re: show a data report with condition
what was the Problem , I said above. actualy I don't know more about it. and what I did I said every thing. so Help me details.
how do you assign a value to it?
how can I do it?
Re: show a data report with condition
Quote:
how do you assign a value to it?
see Post #4
Without more information I can't help you any further.
Good Luck
Re: show a data report with condition
where I write this code:
de1.Commands("rsCommand1").Parameters("param1").Value = txtText1.Text
Private Sub DataEnvironment_Initialize()
End Sub
or
Private Sub rsCommand1_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
End Sub
Re: show a data report with condition
Those both subs are not the real
Quote:
Private Sub DataEnvironment_Initialize()
End Sub
or
Private Sub rsCommand1_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
End Sub
The code
Quote:
de1.Commands("rsCommand1").Parameters("param1").Value = txtText1.Text
must be entered in your sub where you want to kick these DataReport
After entering the code, you need to do next:
datareport.show because otherwise the datareport wil NOT show automatically :blush:
Re: show a data report with condition
you mean I write this?
Load DataEnvironment2
With DataEnvironment2
If .rsCommand1.State <> 0 Then .rsCommand1.Close
.Command1 Text1.Text
End With
de1.Commands("rsCommand1").Parameters("param1").Value = Text1.Text
DataReport2.Show