Results 1 to 2 of 2
Thread: FindFirst (Access 2000)
2002-10-17, 07:43 #1
- Join Date
- Jun 2002
- Thanked 0 Times in 0 Posts
FindFirst (Access 2000)
Can somebody help me with the FindFirstr method? I have a ListBox called ListInvoices, enumerating the payments and the clients.
The row source of my listbox is the following:
strBas = "SELECT orders.paymentid, orders.invoicedate, Payments.CompanyName, orders.Paymentid, orders.paymentid, Payments.afid " & _
" FROM Payments INNER JOIN orders ON (Payments.Paymentid = orders.Paymentid) AND (Payments.Paymentid = orders.Paymentid) " & _
"WHERE (((orders.orderid)>0) AND ((orders.paymentid)>0) AND ((orders.Paymentid) " & strNotIn & " "
I have tried with the following code,put in the OnClick event of a control:
Dim rst As DAO.Recordset, strCriteria As String
Dim strPaymentID As String
strPaymentD = InputBox("Please enter Payment number ")
If Len(strPaymentID) > 0 Then
strCriteria = "ListInvoices = " & strPaymentID
Set rst = Me.RecordsetClone
If rst.NoMatch Then
MsgBox "PaymentID " & strPaymentID & " Not Found!!"
Me.Bookmark = rst.Bookmark
When i click the control, it asks me for the payment number, but then noting happens,no error, but i do not go to the specified number.
2002-10-17, 08:00 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
Re: FindFirst (Access 2000)
ListInvoices is a control on your form, but not a field in its record source, so
<font face="Georgia">strCriteria = "ListInvoices = " & strPaymentID</font face=georgia>
is not a valid criteria string. Try changing it to
<font face="Georgia">strCriteria = "PaymentID = " & strPaymentID</font face=georgia>