Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time Error 424 and Recordsets

Status
Not open for further replies.

tbpcpa

Instructor
Oct 8, 2002
19
US
Private Sub Data1_Reposition()
datOrders.RecordSource = "select OrderDate, " & _
"requiredDate from Orders where " & _
"CustomerID = '" & _
datCustomers.Recordset.Fields("CustomerID") & "'"
datOrders.Refresh
End Sub



gives me a run-time error 424.... basically anything with a recordset in it... what gives?
 
I just created a small app with two data controls pointing to the same database and the following code works fine.

Private Sub datCustomers_Reposition()
datOrders.RecordSource = "select firstname,lastname FROM tblCustomers where CustID=" & datCustomers.Recordset.Fields("CustID") & ";"
datOrders.Refresh
End Sub


The only thing that I can suggest is to make sure of your object names, table and field names and field datatypes. In my example my customer ID is an integer so I left out the single quotes. Thanks and Good Luck!

zemp
 
Well... this was based off the Northwinds supplied database... and at work or at home.. I can't seem to be able to use recordsets at all... always get a Run-Time 424 error... guess I'm missing something somewhere.. thanks though
 
Ok... the code I listed is it primarily... do i need

Private ........ As Recordset and/or
Set ......



I have neither

 
I don't think so. The code that I have posted is all the code in the entire project, except my Option Explicit declaration. The rest is handled by setting the data controls properties at run time.

Sorry I can't be of more help. Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top