Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2006
    Posts
    6

    Question Unanswered: Runtime Error '3021' - No Current Record ?

    Im using MS Access 2003 (on a Access 2000 dbase file) . Im new to VBA programming and Access use and so am getting the following error:

    Runtime Error '3021'
    No Current Record

    on the following:

    Private Sub Form_Open(Cancel As Integer)
    SetJobGroupID (Me.Recordset.Fields("Job Group").Value)
    End Sub

    My form contains several controls on it include the combo box control "Job Group". It's Control Source = "Job Group" and Row Source Type = Table/Query. What I'm expecting to get back is before the form is shown the control will be populated with the "Job Group" field, one of the fields belonging to the Form's Row Source. I then grab this value and pass it to my SetJobGroupID subroutine to store it into a global variable for later use within a WHERE clause.

    This method works for other forms but not this form for some reason.

    Any ideas?

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    error

    You may have success by putting your Form_Open code into the button which is clicked to open the form and after the docmd.openform "xxxx". Just a quick thought but it may not work (you'll of course, have to change a few things such as the me. to Forms!MyForm....etc...)
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •