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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection error

Status
Not open for further replies.

SQLScholar

Programmer
Aug 21, 2002
2,127
GB
Hey all,

Here is my code

Code:
Private Sub Transaction_GotFocus()
 
currentdb.Execute ("select * from table1")
 
If CurrentDb.Recordsets.Count = 0 Then
    Form_Accounts.Transaction.RowSource = "New Business;MTA;Renewal;Cancellation"
Else
    Form_Accounts.Transaction.RowSource = "MTA;Renewal;Cancellation"
End If
 
End Sub

It seems to error on

currentdb.Execute ("select * from table1")

Saying it cannot do a select. Strange thing is this line works fine as in insert, or update - but i need to do a select.

any ideas?

Thanks

Dan

----------------------------------------
There are 2 types of computer, the prototype and the obsolete!!
----------------------------------------
No D, just plank - and its not my fault
 
CurrentDB.Execute (as DoCmd.RunSQL) is used only with ACTION queries.
You have to play either with a Recordset or the DCount function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top