Results 1 to 6 of 6
  1. #1
    projectpupil7 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    37

    Exclamation INSERT INTO behaviour in Tab control with subforms Access 2010

    Hi, this code inserts some values from tblWorkItem(first tab page) into tblReactiveWorkPoList (second tab page). The code worksas expected but if I add in fields "Supplier" and"OrderNumber" the code fails i.e. doesn't copy the records over totblReactiveWorkPoList.No error messagesappear. Both "Supplier" and "OrderNumber" are text fields.



    Before adding the fields I have this:

    CurrentDb.Execute "INSERT INTOtblReactiveWorkPoList(ClientID, Address, AssetNumber, DescriptionOfWorks,InstructionReceived) VALUES(" & Me!ClientID & ", '"& Me!Address & "', '" & Me!AssetNumber & "', '"& Me!Description & "','" & Me!InstructionReceived &"')"
    Forms!frmReactiveTracker.frmReactiveWorkPoList.Req uery


    After adding the fields I have this:

    'CurrentDb.Execute "INSERT INTOtblReactiveWorkPoList(ClientID, Address, AssetNumber,DescriptionOfWorks,InstructionReceived , Supplier, OrderNumber ) VALUES(" & Me!ClientID &", '" & Me!Address & "', '" & Me!AssetNumber& "', '" & Me!Description & "','" &Me!InstructionReceived & "','" & Me!SUPPLIER & "','"& Me!OrderNumber & "')"



    Any offers of help please‼‼‼‼! ???????????

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,967
    Why is data duplicated between tables?

    Need a space between INTO and tblReactiveWorkPoList. Is there really a space in your code and it just did not post here correctly?

    Except for lack of spaces causing run-together, I don't see anything wrong with syntax.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    projectpupil7 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    37

    Exclamation INSERT INTO behaviour in Tab control with subforms Access 2010

    I have attached a zip file for assistance."Surveyors Workload for forum"

    Duplicated data is there at clients adament request even though reservations
    have been explained.
    Yes there is a space after INTO (see in VB code).
    In Reactive Tracker pick "Ian Hatton".
    Click on Add Work Item button.
    Enter details in form Add Work Item and click close.
    On close Add Work Item fields should have copied accross to Reactive Work PO
    subform.

    Thanks for your help.
    Attached Files Attached Files

  4. #4
    projectpupil7 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    37
    Sorry VB password is "pcc"

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,967
    The field in tblReactiveWorkPoList is ORDERNO, not OrderNumber.


    Advise not to use all caps in naming convention.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    projectpupil7 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    37

    Thumbs up INSERT INTO behaviour in Tab control with subforms Access 2010

    Thanks June7, I thought I had changed all the fields but obviously not. So a fresh pair of eyes was very helpful. PROBLEM NOW SOLVED.

    Happy Xmas to you and ALL forums staff and visitors.

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

Similar Threads

  1. Replies: 1
    Last Post: 12-30-2013, 05:56 PM
  2. Access 2010 after insert
    By redja71 in forum Access
    Replies: 3
    Last Post: 06-18-2013, 10:00 AM
  3. Replies: 6
    Last Post: 03-10-2013, 02:36 PM
  4. Replies: 2
    Last Post: 08-29-2011, 03:36 AM
  5. Replies: 7
    Last Post: 08-10-2011, 04:48 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