Results 1 to 6 of 6

Thread: DBCombo_Change

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 1999
    Location
    Preddvor, SI, Slovenia
    Posts
    18

    Post

    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

  2. #2
    New Member
    Join Date
    Jul 1999
    Location
    Chester, NJ, Morris
    Posts
    12

    Post

    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

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 1999
    Location
    Preddvor, SI, Slovenia
    Posts
    18

    Post

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

  4. #4
    Member
    Join Date
    Jul 1999
    Posts
    33

    Post

    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

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Aug 1999
    Location
    Preddvor, SI, Slovenia
    Posts
    18

    Post

    Can I send you my whole project?

  6. #6
    Member
    Join Date
    Jul 1999
    Posts
    33

    Post

    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
  •  



Click Here to Expand Forum to Full Width