|
-
Aug 30th, 1999, 10:10 PM
#1
Thread Starter
Junior Member
I'm very new in database development and I don't know, how to do this:
In my app I use a DBCombo, a TextBox, Data control and DBGrid. When I change the selection in DBGrid, the contents of DBCombo and TextBox change. How can I do this backward - that means when I'll change the item in DBCombo, the selection in DBGrid will change and the TextBox will change its contents? I hope, you understand.
Thanks.
Jure
-
Aug 31st, 1999, 12:22 AM
#2
New Member
I belive in the Dbcombo change event you need to requery the data control like this:
Private Sub DbCombo_Change()
Dim strRecord As String
strRecord = dbcombo.Text
Data1.RecordSource = "Select fieldname from tablename WHERE record Like '" & strRecord & "*'"
dtaFind.Refresh
DBGrid1.ReBind
End Sub
That's how I figured it out.
Hope this helps
pmeredith
-
Aug 31st, 1999, 09:31 PM
#3
Thread Starter
Junior Member
Thank you for your answer, but I don't understand it. I tried to paste your code into my code, but it doesn't work. Error occours at line Data1.RecordSource=...
-
Aug 31st, 1999, 09:53 PM
#4
Member
You're going to need to translate the names of objects in the code to the names of the objects your using. If your data control isn't called Data1, you need to replace Data1 with the name of your data control. Further, depending on the type of data control you are using, the syntax of the code will be somewhat different. Are you using an ADO control, a DAO control, or an RDO control? Or are you using data objects without controls? If you'd like to post the code you have so far I'll check it out and see if I can't come up with an answer for you.
HTH,
Jonathan
-
Aug 31st, 1999, 10:14 PM
#5
Thread Starter
Junior Member
Can I send you my whole project?
-
Aug 31st, 1999, 10:54 PM
#6
Member
Sure. Send it to [email protected]. I'll give it a look.
-Jonathan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|