Results 1 to 7 of 7
  1. #1
    rcrobman is offline Not Expert Yet!
    Windows XP Access 2007
    Join Date
    Apr 2011
    Location
    Toronto
    Posts
    73

    Error -3004 in Form with subform

    I am having this error appear on a form that i have created that has a subform in the Form Footer - the purpose is simple - when you select one of the records above the subform should display the log items for the selected record.

    I have done this many times in previous versions of Access but in the latest version (2016) I am getting a 'Error -3004 - There is no message associated with this error' - message.
    The main form and the subform both have the necessary linking field i.e. common definition nvchar 50 - the main table has the linking field set as a Primary Key and the subtable has the linking field not set as PK - I have tried it with it set to PK.


    I have tried compiling all of the VB code and get no errors. I have tried Compacting and Repair and get no errors.
    The error occurs when I try to open up the form with the subform on it. Both forms individually work perfectly - I can open the main form or the subform by themselves and get no errors.
    Interestingly this application has several similar forms with subforms in the Form Footer and they all work perfectly well - though these forms were designed in earlier versions of Access.
    Completely baffled on this one - anyone else seen this in any version of Access but particularly Access 2016?
    Thanks for any help!

  2. #2
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Could be a bit of corruption.
    Try deleting the subform container on the main form. Compact and Repair the database.
    Re add the subform and recreate the Master Child values if they aren't picked up automatically.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    rcrobman is offline Not Expert Yet!
    Windows XP Access 2007
    Join Date
    Apr 2011
    Location
    Toronto
    Posts
    73
    Thanks so much for your suggestion - I have tried that several times - can't figure this out - sure wish if they are going to give me error codes and have the form not work that you at least give me some idea of where to start looking. Strange thing is I have done this particular type of form/subform over and over and it always works - can't figure out what makes this different. The thing that worries me the most is that all previous forms were developed in an earlier version of Access - this is the first time I have developed one in Access 2016 - sure hope they haven't screwed up the ability to do this!

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Here's something to try - only takes a couple of minutes.
    Create a blank database and use the ribbon <External Data><New Data Source><From Database> to import all the objects from the problem database.
    See if the new DB works.

  5. #5
    rcrobman is offline Not Expert Yet!
    Windows XP Access 2007
    Join Date
    Apr 2011
    Location
    Toronto
    Posts
    73
    Thank you so much for your suggestion - what it did was finally show me where the problem must lie. When I opened the form it had no subform on it - so I dragged the subform onto it and hit run - not knowing that it hadn't created the Master/Child links - the form opened fine and showed the one record that was in the table. However when I chose another master record nothing changed so I went and put the Master/Child relationship in for the subform and hit run - you got it Error -3004... which leads me to believe that there is something about the table structures that it doesn't like but damned if I can find it. So here is a snapshot of the two tables in question - the Master/Child field is the SubsID field. The first snapshot is the Master table and the second is the Child table - I can't see any reason that Access would object to the linked fields????
    Thanks for any further help = got me baffled!

    Click image for larger version. 

Name:	Master Table.jpeg 
Views:	11 
Size:	285.6 KB 
ID:	36215Click image for larger version. 

Name:	Child table .jpeg 
Views:	11 
Size:	108.9 KB 
ID:	36216

  6. #6
    rcrobman is offline Not Expert Yet!
    Windows 10 Access 2016
    Join Date
    Apr 2011
    Location
    Toronto
    Posts
    73

    Thumbs up Error -3004 Problem Solved

    For those of you who tried to help I finally found the answer and you likely won't believe it!

    The problem was caused when I set one of the fields in the main form to be a Hyperlink and display If Hyperlink. Believe it or not when I took away the Is Hyperlink as the field property the error went away. Sadly I had to start a new re-design of the form/subform and test it each time I added a field or changed anything on the main form - finally when I set the field I needed to be a hyperlink the error reappeared!! Access didn't seem to care that the field WAS a hyperlink event just that I told it to display as a hyperlink! So I left it as display As Hyperlink Always and just changed the main field text colour to match the normal hyperlink colour - what is so strange is that I have probably 4 or 5 more form/subforms that do have fields set to be Hyperlinks and they work just fine!
    Thanks to everyone who tried to help!

  7. #7
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Most experienced developers avoid the hyperlink datatype as it can be problematic.
    Much better to use a standard text field, format in blue & underlined & use Application.FollowHyperlink "http://www.myURL.com"
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Error when linking subform to form
    By N7925Y in forum Forms
    Replies: 12
    Last Post: 10-07-2016, 01:44 PM
  2. Error 3201 on Form / Subform
    By jerem in forum Programming
    Replies: 2
    Last Post: 12-01-2012, 12:34 AM
  3. Form/Subform commit row error
    By jbickl in forum Forms
    Replies: 2
    Last Post: 03-31-2012, 07:19 PM
  4. Form works, Subform gets error
    By jlclark4 in forum Forms
    Replies: 9
    Last Post: 01-03-2011, 09:24 AM
  5. Form and Subform error trapping
    By usmcgrunt in forum Forms
    Replies: 8
    Last Post: 09-12-2010, 11:54 AM

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