Results 1 to 2 of 2

Thread: A problem with codeing and access hateing me

  1. #1
    Join Date
    Jun 2003
    Location
    Bloomington, IN, USA
    Posts
    116

    A problem with codeing and access hateing me

    Ok, I have a form that 'deletes' a name from the active project leaders list. In actuality, it delets nothing and simply removes the active checkmark from the project leaders table, thus making them in-active. The code I used is below, but here is the funny part. It worked, exactly as it is below, then i saved and closed the form and code, then went back in a few min later ot adjust some sizeing, and it stopped working, and now will not start to do so again.

    oh and the form works by selecting a name from a combo that is attached to a query that takes all the active names form the list then filters the form based off of the returned Project_Leader_ID.

    Anyone know another way or can think of any good advice to keep this from happening again?

    Private Sub DeleteCommand_Click()
    On Error GoTo Err_DeleteCommand_Click

    Dim rst As DAO.Recordset 'recordset to set project numbers in key tables
    Set rst = CurrentDb.OpenRecordset("tblID_lookup_Project_Lead er")
    rst.Index = "PrimaryKey"
    rst.Edit
    rst!Active = 0
    rst.Update

    Me.cboName.Requery

    Exit_DeleteCommand_Click:
    Exit Sub

    Err_DeleteCommand_Click:
    MsgBox Err.Description
    Resume Exit_DeleteCommand_Click

    End Sub

    tblID_lookup_Project_Leader:
    Project_Leader_ID -> autonumber (PK)
    Employee_Reference_Number_ID -> number
    Active -> yes/no

  2. #2
    Join Date
    Jan 2003
    Location
    UK
    Posts
    277
    have you got a

    Dim CurrentDb as Database

    somewhere in your code ?

Posting Permissions

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