Results 1 to 13 of 13

Thread: show a data report with condition

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    222

    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

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    222

    Re: show a data report with condition

    help me with this thread

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: show a data report with condition

    Thread moved to Reporting forum

  4. #4
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,515

    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

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    222

    Re: show a data report with condition

    please modify my code with your suggestion. and post it.

  6. #6
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,515

    Re: show a data report with condition

    I would have to see your dataenvironment. What don't you understand?

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    222

    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)"

  8. #8
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,515

    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?

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    222

    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?

  10. #10
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,515

    Re: show a data report with condition

    how do you assign a value to it?
    see Post #4

    Without more information I can't help you any further.

    Good Luck

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    222

    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

  12. #12
    New Member
    Join Date
    Apr 2009
    Posts
    1

    Re: show a data report with condition

    Those both subs are not the real

    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
    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

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    222

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width