Results 1 to 6 of 6

Thread: bound controls revisited

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    25

    When the user opens a file from a common dialog box i want the project to update the text boxes on my form with data from the dbf file they select. how do i do this?

    please help.

    thanks in advance.
    If you reach total enlightenment while drinking a beer, I bet it makes beer shoot out your nose.

    VB5 Enterprise SP3

  2. #2
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Gig Harbor, WA; Posts: 89950
    Posts
    360
    OK so you have bound the control to the ADO, through the Datasource. And in the Datafield property you have set the table. The textboxes were set to the fields right?
    So under the common dialog click (change) event procedure, do you have the code telling it to change?
    Lee
    Mahalo
    VB6(SP5), VC++, COBOL, Basic, JAVA
    MBA, MCSD, MCSE, A+
    Computer Forensics

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    25

    Question


    What is the code to make it change?


    If you reach total enlightenment while drinking a beer, I bet it makes beer shoot out your nose.

    VB5 Enterprise SP3

  4. #4
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Gig Harbor, WA; Posts: 89950
    Posts
    360

    Exclamation

    If you have them bound, and ready to go the text should display when the click event is fired. If the text does not change then refresh the form.
    Mahalo
    VB6(SP5), VC++, COBOL, Basic, JAVA
    MBA, MCSD, MCSE, A+
    Computer Forensics

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    25
    Here is the code for my open file dialog:

    Private Sub Open_Click(Index As Integer)
    On Error GoTo ErrHandler
    'set filters
    CommonDialog1.Filter = "DBF (*.dbf)|*.dbf"
    'display file open box
    CommonDialog1.ShowOpen
    Data1.DatabaseName = CommonDialog1.filename 'sets database as selected file

    Text2.DataField = "MARKET" 'this is the name of the field i want to pull

    frmGlobal.Refresh

    ErrHandler:
    Exit Sub

    End Sub

    In the options for text2 the datasource is set as data1.

    when they open the file the value in "MARKET" does not show up in the text box.
    If you reach total enlightenment while drinking a beer, I bet it makes beer shoot out your nose.

    VB5 Enterprise SP3

  6. #6
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Gig Harbor, WA; Posts: 89950
    Posts
    360
    Under the field "Market" I am assuming there are multiple entries?
    It looks to me that you need to move the recordpointer to the first entry in the field, (or desired entry).

    .movefirst

    It dosen't know where to look, do you know what I mean?
    ...But what do I know!
    Lee
    Mahalo
    VB6(SP5), VC++, COBOL, Basic, JAVA
    MBA, MCSD, MCSE, A+
    Computer Forensics

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