Results 1 to 8 of 8
  1. #1
    Valentino is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2020
    Location
    Lugano, Switzerland
    Posts
    4

    OnLoad - Recordset Method returns runtime error 91

    Dear all, I’m going to put myself in a deep hole. I try to do something that all the experts I asked for help couldn’t give an understandable answer or couldn’t give me an answer at all. I hope that someone of you is willing and capable to help me out.


    What I want to do is, on opening of a form, to show a logo, taken from a table (just a single record table), in a control inserted in the form’s header.
    The idea is that the user who installs the application has to input, apart from other data, a logo, to be used on every form or report originated from the application. This way of acting is due from the fact that every user who installs the application has a different logo (Tennis club, Golf club, etc.).
    On form opening I get a runtime error #91, which I suppose means there is something wrong with the recordset expression.
    I’m stuck with this issue and cannot progress.
    Any help please?
    Attached is the concerned database, with tables and masks. The mask on the lower side is not working due to lack of other application parts.
    Many thanks in advance.

    I'm unable to attach database. It appears to be too big. Almost 900 Kb. How can I attach it? How can I reduce it? It contains just 2 tiny tables and a form.

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    You need to ZIP it up before attaching it.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Valentino is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2020
    Location
    Lugano, Switzerland
    Posts
    4
    Thank for input.... I'm a bit puzzled right now...

    Here the file...

    Test Form Header.zip

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Here you go, please note that I replaced your Logo control on the form to an Image Control.

    Cheers,
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    Valentino is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2020
    Location
    Lugano, Switzerland
    Posts
    4
    Many thanks Vlad, you were very helpful!

    I have two more questions:
    1. What is the difference between Recordset.Close and Set Recordset = Nothing?
    2. Can this code be used as it is in a function and if not can you give me some advice?

    Many thanks

  6. #6
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Hi Valentino,

    See this for the first question:https://stackoverflow.com/questions/...in-a-recordset
    And look at the updated file for the function.

    Cheers,
    Vlad
    Stay safe
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  7. #7
    Valentino is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2020
    Location
    Lugano, Switzerland
    Posts
    4
    Many many thanks Vlad! I'm so happy about your help!

    Stay healthy as well,
    Valentino

  8. #8
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    You're welcome, good luck with your project!
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combo box Dropdown method on form's OnLoad event
    By MishaLjusha in forum Forms
    Replies: 1
    Last Post: 03-23-2017, 03:57 AM
  2. Replies: 1
    Last Post: 09-17-2015, 10:04 PM
  3. Replies: 3
    Last Post: 09-18-2014, 12:24 PM
  4. Runtime error 1004 - Save method of workbook failed
    By captdkl02 in forum Programming
    Replies: 2
    Last Post: 01-03-2013, 05:53 AM
  5. Replies: 5
    Last Post: 08-05-2009, 04:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums