Results 1 to 3 of 3

Thread: Viewing A Database

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    3
    I'm using Data Enviroment Designer to link to my Access 2000 database in VB6.

    When a user clicks on the Find command, a pop-up window appears and the user double-clicks on the BookID. That information should appear in the program, but it doesn't.
    Here's the code from frmBuyer:

    Private Sub cmdFind_Click()
    '
    ' call find pop-up dialog
    '
    Me.Key = ""
    '
    frmFind.Show vbModal
    '
    If Me.Key <> "" Then
    With deBooks6.rscomBuyers
    .MoveFirst
    .Find "BuyerID=' " & Me.Key & " ' "
    End With
    End If
    '
    Unload frmFind
    End Sub

    Here's the code from frmFind pertaining to the FlexGrid:

    Private Sub MSHFlexGrid1_DblClick()
    '
    ' pass selected record to caller
    '
    With Me.MSHFlexGrid1
    If .Col = 0 Then
    frmBuyers.Key = .Text
    Me.Hide
    End If
    End With
    '
    End Sub

    Can anyone tell me why it's not pulling into the main program? Using debug to step-thru, .Find "BuyerID=' " & Me.Key & " ' " does show that me.key contains the value of the BuyerID field from the FlexGrid when it is double-clicked.

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    You have a space before and after the single quote

    .Find "BuyerID=' " & Me.Key & " ' "


    try this:

    .Find "BuyerID= '" & Me.Key & "'"

    HTH

    Tom


  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    3

    No spaces in quotes

    I copied your suggestion into my code and reran it but to no avail. It still doesn't pull in. The spaces you see were put there by VB6 but are not really spaces.

    I'm at my wits end.....

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