[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 451
  • Last Modified:

openrecordset run time error 424

Dim st As Integer, rs As Recordset

    Set rs = gf_db.OpenRecordset("SELECT * FROM tblCount WHERE ID = '" & strCounter & "'")

I get the runtime error when running this on access 2003
0
jfgk
Asked:
jfgk
1 Solution
 
Joe OvermanEngineerCommented:
Do you have lines indicating:

Dim gf_db As Database
Set gf_db = CurrentDb
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
You can simply with this:

     Dim st As Integer, rs As DAO.Recordset
    Set rs = CurrentDB.OpenRecordset("SELECT * FROM tblCount WHERE ID = '" & strCounter & "'")

mx
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now