Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jun 2004
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Box error (97)

    I have a combo box with the following update procedure:

    Private Sub cboBillingCode_AfterUpdate()

    Dim rs As Object
    Set rs = Me.RecordsetClone
    rs.FindFirst "[BillingCode] = '" & Me![cboBillingCode].Column(1) & "'"
    Me.Bookmark = rs.Bookmark
    End Sub
    I get an error that says runtime error 3021, cannot find current record.
    When I put a breakpoint at the start of the sub, the de###### is stopping on the me.bookmark = rs.bookmark line.
    The combo box is unbound with row source SELECT tblBillingCode.[BillingCode] & " - " & tblBillingCode.[Description] as FullDesc , tblBillingCode.[BillingCode], tblBillingCode.[Description] FROM tblBillingCode ORDER BY tblBillingCode.[BillingCode];
    Thanks,

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

    Re: Combo Box error (97)

    Do you get this error irrespective of which item you selected in the combo box, or only for some choices?

  3. #3
    2 Star Lounger
    Join Date
    Jun 2004
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box error (97)

    i get the error for any item i select

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

    Re: Combo Box error (97)

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

  5. #5
    2 Star Lounger
    Join Date
    Jun 2004
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box error (97)

    Here is the database

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

    Re: Combo Box error (97)

    In the first place, you must remove the lines

    txtBillingCode.Value = Null
    txtDescription.Value = Null

    in the On Load event of the form. These instructions actually modify the first record in the table/form, and since BillingCode is the primary key, it cannot be Null. If you would like the form to start with a blank new record, replace those two lines with

    RunCommand acCmdRecordsGoToNew

    The combo box works OK for me after removing the two lines (with or without the RunCommand line).

Posting Permissions

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