Results 1 to 2 of 2

Thread: DBcombo & text box ...

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 1999
    Location
    Decatur, AL US
    Posts
    14

    Post

    OK ... I have just started with VB6 so bear with me ....

    I have a database that has two different fields ... one that's a class (ENG101) and one that's a Description (English 101) ... I need to bound those two together so when I pick one then the other one Automatically shows up.

    I want to use a DBcombo box control for picking the class and I would guess a text box for showing the description of the class I just picked ...

    Can this be done?
    If so ... HOW ?

    Any help is GREATLY appreciated.

    Shawn

  2. #2
    New Member
    Join Date
    Jun 1999
    Location
    kaysville, Ut, US
    Posts
    13

    Post

    If you are using an access database then you can bind the DBCombo box to the .mdb file. To do so, put a data control on your form.

    Set DatabaseName to the database you will be using.

    Set Recordsource to the table in the database you are using. (I would guess you only have one table in your database)

    Set DataSource on DBCombo to the name of the data control.

    Set DataField of DBCombo to the correct field (in this case Class name)


    Set Text1(or whatever you text box is called) DataSource to the name of the data control.

    Det Datafield of Text1 to the correct field (class description).

    Of course this will display the class description all the time.

    If you want to only show the class description when they have selected a class then set the datafield and datasource in the code:

    text1.datasource = name of datacontrol
    text1.datafield = name of field

    then after they are done set them to ""

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