Results 1 to 6 of 6
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Cannot Find Field Error (2003 / 2000)

    I have a form with a combo box that selects the type of material from a table. However, it I try to exit the form (i.e. to save the record) with the combo box blank I get the following message.

    "The Microsoft Jet database engine cannot find a record in the table "tblMaterial" with key matching field(s) 'Material1'"

    There are occasions when I want to save the record without entering a material. I gather that the error stems from the fact that the tblMaterials doesn't have a null entry fo match the empty combo box on the form. How do I get around this?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cannot Find Field Error (2003 / 2000)

    Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  3. #3
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Cannot Find Field Error (2003 / 2000)

    Hi Hans,

    Well, the previous problem somehow cured itself, but now I have a new one. The code below is intended to open up a new blank "frmOrderTracking" form. But instead it does the same as acNormal, i.e. it opens up the form with data from existing records. This command used to work properly, but now it doesn't. I'm completely puzzled.

    Private Sub cmdNewOrder_Click()
    On Error GoTo Err_cmdNewOrder_Click

    Dim stDocName As String
    stDocName = "frmOrderTracking"
    DoCmd.OpenForm stDocName, , , , acFormAdd

    Exit_cmdNewOrder_Click:
    Exit Sub

    Err_cmdNewOrder_Click:
    MsgBox Err.Description
    Resume Exit_cmdNewOrder_Click

    End Sub

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cannot Find Field Error (2003 / 2000)

    Do you have code in the On Open or On Load event of frmOrderTracking that might negate the acFormAdd argument?

  5. #5
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Cannot Find Field Error (2003 / 2000)

    Sorry to bother you. The problem was too many commas before the acFormAdd. I'm feeling rather dumb these days!

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cannot Find Field Error (2003 / 2000)

    No problem. Things like that happen to all of us! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

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