PDA

Click to See Complete Forum and Search --> : Viewing A Database


tfisher
Mar 27th, 2000, 09:35 PM
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.

Clunietp
Mar 27th, 2000, 10:34 PM
You have a space before and after the single quote

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


try this:

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

HTH

Tom

tfisher
Mar 27th, 2000, 11:06 PM
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.....