borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Need Help Urgently !!)Next Topic (How to make the Data Combo search automatically) New Topic New Poll Post Reply
AndreaVB Forum : Database : Display In DataGrid
Poster Message
boye-i
Level: Scholar

Registered: 22-10-2002
Posts: 43

icon Display In DataGrid

Help!!

Someone to help on the followin questions:
1. If i have a text box and a datagrid linked to a an ADO control with properties linked an Access database; how do I produce a query results in the datagrid based on the value in the textbox?

2. How do I produce a crystal Report from VB 6.0 based on the value of a datepicker control.
What will be the code under the command button?

Regards,
boye-i

____________________________
IKBoye

18-12-2002 at 11:23 AM
View Profile Send Email to User Show All Posts | Quote Reply
Shady
Level: VB Guru


Registered: 08-07-2002
Posts: 305
icon Re: Display In DataGrid

Not 100% sure if this is what you are after, but in case you are here goes.

The following code allows you to enter text into a text box and display only the records in your database which contain the text.


Dim Wilcard As String
Wildcard = "*" & SearchString.Text & "*"

Data1.RecordSource = "SELECT * FROM [Table] WHERE [Field] LIKE '" & Wildcard & "'"
Data1.Refresh


All you need to do is place this code under a button and have a text box called SearchString on your form.  So long as you have linked a data control to a DBGrid (which should also be on the form) it will display only matching records.

NB:[Table] must be replaced with the name of the table you are querying and [Field] to be replaced by the name of the field you wish to query.


Hope it helps

Shady


____________________________
I don't wanna die... but I ain't keen on livin' either

19-12-2002 at 03:45 PM
View Profile Send Email to User Show All Posts | Quote Reply
boye-i
Level: Scholar

Registered: 22-10-2002
Posts: 43
icon Re: Display In DataGrid

Shady,
Thanx for your help. You left out the crystal report question. Can you please help!!

IKE

____________________________
IKBoye

19-12-2002 at 04:36 PM
View Profile Send Email to User Show All Posts | Quote Reply
Shady
Level: VB Guru


Registered: 08-07-2002
Posts: 305
icon Re: Display In DataGrid

I'm very sorry my friend, I left out your second question because unfortunately I do not know the answer.

Regards

Shady

____________________________
I don't wanna die... but I ain't keen on livin' either

20-12-2002 at 09:04 AM
View Profile Send Email to User Show All Posts | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: Display In DataGrid

i don't know much, but i hope this idea isn't worhtless..

create a textbox, and have it have access properties. keep it invisible if you want.
then, when the date is picked in the datepicker, do you think you could get the value of the date picked and send it to the textbox? with the date being part of the database already, then when you make your crystal report, the textbox will show, since it does have the datasource stuff...

code?

oops... i don't have any on that. sorry.
my idea was ALL i had to give.    

____________________________
Been busy trying to take a second degree <--it's not working out...

20-12-2002 at 09:16 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : Display In DataGrid
Previous Topic (Need Help Urgently !!)Next Topic (How to make the Data Combo search automatically) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder