Results 1 to 7 of 7
  1. #1
    zool is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Location
    Miri
    Posts
    21

    Runtime Error 7 and unable to Requery

    Hi,

    I'm having a huge problem with my database. I could not execute requery command due to Runtime Error 7.
    I have 2 forms, New Equipment and Equipment Database. I'm trying to Requery the data whenever there are changes made into New Equipment form.
    I have two options to execute Requery, 1. Using command button 2. New Equipment form changes.
    I don't know whether it is correct, i tried to put [Form_Equipment Database].Requery on of the two options but it came out as Runtime Error 7.
    Is there any other way to Requery the data inside my Equipment database form?

    This is my database if you're interested to solve it.
    http://www.filedropper.com/equipmentdatabase

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    The syntax of the requery command is incorrect:

    try: Forms![Equipment Database].requery (the form must be open), or if you are requerying the current form, Me.requery works just as well.

    I don't know why you are getting Error 7, though.

    PS - You do realize, I hope, that forms do not contain data - they only display, modify or enter it.

    HTH

    John
    Last edited by John_G; 08-15-2012 at 10:22 AM. Reason: additional comment

  3. #3
    zool is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Location
    Miri
    Posts
    21
    Thanks for the reply, however your method doesn't work. This time it shows different error. "Method 'Item' of Object 'Forms' failed"

    I do realize that forms does not contain any data because that is how I intended it to be - only Equipment Database forms has data.
    I'm having a hard time to create this database because the last time i made one for my project was 4 years ago
    Please give me any feedback so that I can improve the database.
    Thanks.

  4. #4
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    Please post the Sub with the code that is generating the error. It's hard to diagnose a problem without seeing the source.

    What is the structure of your database? You mention two forms - do they both have the same table as a recordsource?

    Please post more info - thanks!

    John

  5. #5
    zool is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Location
    Miri
    Posts
    21
    I think that I need to revise back the database structure. There is a possibility that the structure is the one causing the error.

    I have several questions here.
    Is it better to have a form which is mean to be edited get the data directly from table or use query?
    I used query so that I can combine all the data inside one form easily.

    Is there any good site to learn Access (starting from design of ERD/Data Model up to Advance training) for free?

    New problem:
    I've fixed the requery problem using "DoCmd" but new problem arised after that.
    I could not set HasModule on form because i converted accdb to mdb (my colleague used Access 2007).
    Because of this, all command on my buttons disappear. If i set the HasModule to Yes, I can not save the database after making modifications.
    Do i need to redo the whole database using mdb format?
    Last edited by zool; 08-16-2012 at 09:11 PM. Reason: additional problem

  6. #6
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    For the first question, my own opinion is that a form used to update data should where possible be based on a table, or a query based only on that table. You can use a multi-table query if it is updatable, but if the query is one-to-many, you really have to know what you are doing. Use a main form - sub form arrangement instead.

    I can't answer the second question because I don't have A2007 - but if conversion from accdb to mdb results in loss of all your form code, Microsoft has a very serious issue to resolve (IMO). Can our experts help, please?

    John

  7. #7
    zool is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Location
    Miri
    Posts
    21
    Thank you John.

    I'm trying to restructure my database and create lots of tables and queries so that the database will be more flexible.

    The conversion from accdb to mdb creates a huge problem for me since i have to remove all my code in order to save the database. Basically i had to recreate the database.

    I have another question here. Is it possible to sum data from specific table using expression builder? I do not intend to use query's "sum" function because it will hide other data which it could not sum up.
    Solved: Just need to create additional queries, 1st query to "store data temporary" and 2nd query to calculate the temporary data.
    Last edited by zool; 08-24-2012 at 12:44 AM. Reason: solved

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

Similar Threads

  1. Replies: 13
    Last Post: 06-12-2012, 09:52 PM
  2. Unable to fix error
    By RandomBoilermaker in forum Access
    Replies: 3
    Last Post: 04-27-2012, 11:41 PM
  3. Replies: 4
    Last Post: 03-26-2012, 12:45 PM
  4. Unable to fix a missing operator error
    By dhaneshjs in forum Access
    Replies: 6
    Last Post: 05-25-2011, 10:14 AM
  5. Error in Runtime Only
    By drunkinmunki in forum Programming
    Replies: 7
    Last Post: 12-16-2010, 03:43 PM

Tags for this Thread

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