Results 1 to 7 of 7
  1. #1
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776

    Syntac Error When new record afterupdate event

    Hi all,
    I have attached db and when i try to add a new address i get an error. I have spent two days trying to figure this out but i cannot find a solution to this.
    CompanyProfileFrm needs to be open first, then CompanyAddressFrm to add a new address to the company and location

    The qry works but i cant get rid of this error and wont let me add a new address to this. Please assist if you would.
    I had to remove most all data from this db to get it to allow me to add here! Data is limited,
    Thanks

    DavedbProfileNew - Copy.zip

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    what is the error number and description?

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by d9pierce1 View Post
    Hi all,
    I have attached db and when i try to add a new address i get an error. I have spent two days trying to figure this out but i cannot find a solution to this.
    CompanyProfileFrm needs to be open first, then CompanyAddressFrm to add a new address to the company and location

    The qry works but i cant get rid of this error and wont let me add a new address to this. Please assist if you would.
    I had to remove most all data from this db to get it to allow me to add here! Data is limited,
    Thanks

    DavedbProfileNew - Copy.zip
    I'm not sure that your tables are structured properly. Can you explain what each one is for and how they are related
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Click image for larger version. 

Name:	Error1.jpg 
Views:	12 
Size:	44.1 KB 
ID:	42684
    This is the error however i do get a syntax error following 3134

  5. #5
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Thanks,
    The AddressTbl Stores All Addresses and Address Info such as Address Type, City, state, ZipCode, and County
    The LocationTbl stores the company location info
    The Company2AddressByLocationTbl stores CompanyLocationID and the AddessID (ManytoMany) Sort of
    What i am looking for is to be able to have multi address for one companytype, Such as the company I work for has mutli locations. I want to have multi addesses and address types per location.
    Hope that makes sense!

  6. #6
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Better Description!
    I had to remove a lot of things from this db to be able to post here so some a lot of data and tables have been removed. Current tbl,qry and frm are related to this issue.

    CompanyTbl Stores company names...and not related misc to this issue.
    CompanyLocationTbl stores CompanyLocationID,CompanyID, Location and non related
    AddressTbl stores AddessID, AddressTypeID, Address info and City, State, ZipCode, and County along with other non related...
    Company2AddressByLocation is many to many tbl, Where stores the AddressID and the CompanyLocationID
    CompanyLocationQry populates the CompanyLocationFrm. That works well, no errors...
    Company2AddressByLocationQry populates the CompanyAddressFrm and that where we have issues.

    Once I select an AddressType from the CboAddressType, i get the above error? It should begin new record, then the after update event should fire and put the AddressID and CompanyLocationID in the Company2AddressLocationTbl? I normally get a syntax error after that fires for some reason.

    I beleive i have something wrong with the Location? I need to have multi address per company locations and multi locations for one company. The Query for the CompanyAddressFrm seems to display the correct info, yet will not allow me to make a new record?
    I have no idea what is going on with that.

    Thank you
    Dave

  7. #7
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Thanks all,
    I found a solution so hopefully it will work correctly again!
    Dave

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

Similar Threads

  1. Replies: 6
    Last Post: 03-26-2019, 11:59 AM
  2. Error checking in AfterUpdate event
    By klnlsu in forum Forms
    Replies: 3
    Last Post: 02-04-2016, 09:50 PM
  3. Replies: 4
    Last Post: 10-29-2014, 03:49 PM
  4. Replies: 7
    Last Post: 01-02-2012, 06:19 PM
  5. AfterUpdate event code error?
    By agripa86 in forum Programming
    Replies: 3
    Last Post: 08-12-2011, 09:12 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