Recent content by mrmozambique

  1. M

    Correct way to express filter in VBA

    You don't know how long I've been doing this - :banghead: because of these quotes. Thanks a ton. This did the trick.
  2. M

    Correct way to express filter in VBA

    Hi all. I struggle with this every time I try to do it and it seems that I can never find the solution online. I have an unbound combo in the header of a continuous form with a list of districts (text). I want to filter the form based on the text field [DistrictName]. I have the following...
  3. M

    Run-Time Error 91 trying to create recordset in VBA

    Thanks for the responses, guys. I'm getting a type mismatch error now on the Set rcst = dbs.OpenRecordSet line. I always struggle with this in VBA. All form objects (e.g. txtDispCycle and cbFacilityID) are integers as are db fields (e.g. DispCycle, FacilityID). How will that change where the...
  4. M

    Run-Time Error 91 trying to create recordset in VBA

    Hi all. Searched everywhere, but I don't seem to understand the meaning of this error. I'm trying to create a warning message box if the user tries to enter a duplicate record (but still allow it). My code is below. The error occurs when I try to set rcst equal to the recordset of rslt...
  5. M

    Runtime Error 2501 on acCmdImportAttachExcel

    Good one, SOS. Here's my new code and it works fine (although a bit imperfect with the ErrHandler). The form error handler doesn't catch the 2501 error in this case as it happens outside of the form (browse dialog). When the user clicks Cancel in the browse dialogue, it still creates a 2501...
  6. M

    Runtime Error 2501 on acCmdImportAttachExcel

    Thanks, Trevor. So if I'm looking through 2007 at these libraries, I won't see the 2003 Access (11.0) library, correct? I had a look at the exhaustive list and didn't see anything there that contained Access/Office 11.0. Regardless, I'll speak to my customer tomorrow and see if she can reset...
  7. M

    Runtime Error 2501 on acCmdImportAttachExcel

    Greetings, all. I personally am running 2007, but a customer of mine is using 2003 (trying to get exact version). I have a label on a simple form that opens an import from Excel window (ImportAttachExcel). On my 2007 Access and nearly all others it works fine. However, one customer of...
  8. M

    Unbound combobox in header not obeying 3058 error handling

    Thanks for all your help. I'm sure I'll be back soon! Cheers
  9. M

    Unbound combobox in header not obeying 3058 error handling

    I'm pretty sure I have. It catches all the other possible ways to create the 3022 and 3058 errors except when I use the unbound combos in the header. Is this not the form's OnError event? Private Sub Form_Error(DataErr As Integer, Response As Integer) If DataErr = 3022 Then MsgBox "This...
  10. M

    Unbound combobox in header not obeying 3058 error handling

    That's the thing. It seems like something that the form's On Error should catch, but for some reason it doesn't. I seem to have sorted it out using a control-level error handler to trap it. Since the unbound comboboxes won't accept an Undo command, I also had to create two unbound text...
  11. M

    Unbound combobox in header not obeying 3058 error handling

    Ha! I don't want to enter duplicate records. However, the DB isn't just for me to use and you know what they say about software users...they're like water. If there's a hole, they'll find it. It seems awfully complicated to have to check the combination of five records after each control's...
  12. M

    Unbound combobox in header not obeying 3058 error handling

    They're actually not required fields. The primary key is actually made up of about five fields which always has to be unique. There's no way to get out of the primary key comibination. Does that make a difference?
  13. M

    Unbound combobox in header not obeying 3058 error handling

    Hi VBAInet. I was able to sort out the 3058 error with some tricky If Thens under the GotFocus events of the unbound comboboxes in the header. However, I'm having the exact same problem if I enter a duplicate record (error 3022) in the continuous subform and then try to click on the header...
  14. M

    Unbound combobox in header not obeying 3058 error handling

    Hi all. I haven't posted here for a while, but visit regularly. I'm hoping you might have some ideas about an issue I'm having with a subform. I have a mainform and a continuous subform. The continuous subform has a header with two unbound comboboxes that are used to filter the results in...
  15. M

    Problems with filter in subforms

    Thanks, Bob. Unfortunately, changing it didn't help me. Another thing that's strange is that even if you hardcode the filter in the subform properties, it doesn't keep after you close the form. It goes back to a blank filter property. Any idea why this happens? One thing I failed to...
Top Bottom