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

I would say that your problem stems from .rsCommand1.State <> 0 Not every property and method is supported by every type of Database: In your case an Access database.

It looks like the State property is not supported.

I made another report by this code. like I select two date (from and to) show data for a preiod like a week or a month. there I use it.

however Please tell me what code I can use here.

please help me with this thread

help me anybody

help me any body

.Command1 Text2.Text What values are you getting for Text2.Text?

What values are you getting for Text2.Text?

I don't understand

What values are you getting for Text2.Text?
I don't understand

Text2.Text has a string value: e.g. "Joe", "Schmo","123", etc. If you put a break at this section of the code, what is it returning?

(param1 as long)

(param1 as long)

So, you answer my question with another variable. That's interesting. And so, if I ask you what the value of Param1 is you would give me another variable?

Perhaps Param2?

hmmm... data report with condition?...

try browsing to my site > Downloads > AE4AA Projects > Computer Shop...

www.silentproject.cjb.net

..That project my solve your problem...

..its free.. USE IT FOR YOUR PRIVATE STUDY...

..but any Donation would be apreciate... hehehe..

..HOPE YOU WILL LOOK FOR IT... THANKS..

So, you answer my question with another variable. That's interesting. And so, if I ask you what the value of Param1 is you would give me another variable?

No value in param1

No value in param1

Well, that's probably your problem. I would say you need some value there for your database command. You need to figure out why no value is in that variable at that point in your program.

Load DataEnvironment2
With DataEnvironment2
If .rsCommand1.State <> 0 Then .rsCommand1.Close
.Command1 Text2.Text
End With
DataReport2.Show

So, if you set a breakpoint at line 3 by clicking in the column to the left of the code, your program should stop at that point and you should be able to determine what value is in Text2.Text. You can use [F8] to step through your code 1 line at a time. If there is none, then you need to fix that bug so that your command1 will have a parameter that it can use. It can't use a NULL value.

hmmm... data report with condition?...

try browsing to my site > Downloads > AE4AA Projects > Computer Shop...

www.silentproject.cjb.net

..That project my solve your problem...

QUOTE]

1. its a log in form. need password.
2. in print button there was no condition

You can use [F8] to step through your code 1 line at a time. If there is none, then you need to fix that bug so that your command1 will have a parameter that it can use. It can't use a NULL value.

yes there is none, how can I fix .....

help me

You should have the same data type of both value from which you are applying the condition and comparing with
like
if the ID of student is 123 as a integer
but you are comparing with "123" from a text box value (which is a string by default) so you may suffer

So type casting will be helpful..

hmmm... dont know why you are using data environment... when im doing some report in vb i just use the Data Report thats it....

1. Design Your Data Report.
2. Use the Field Name for your Report field source... (forgot whats the property name for it...LOL)
3. In code in VB....


Datareport1.RecordSource = RS '(Something like that..)


Just explore my vb project and you will get it.... I hope....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.