Results 1 to 4 of 4
  1. #1
    kamran1514 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    2

    Save record only if the same exisits in another table


    table A has 10 records where 1 field is set as REQUIRED/UNIQUE. the table B does not have any record but have a same field like table A. what I want is that if user insert the record in table B it should first check whether record is already present in table A or not, if already exists it should not accept insertion. and if not already there in table A it should insert record in table B. any help in this regard will be highly appreciated.

  2. #2
    stmoong is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    You will need to write some VBA code and queries to do that.

    Out of curiousity, what is the reason to have such a design?

  3. #3
    kamran1514 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    2
    Dear Stmoong, thanks for you reply. can you please tell me that how can I do this with VBA and Queries, please note that I am not very expert in programming but can surely follow your instructions to achieve the goal. the reason to have such design is that database has become very slow. I will highly appreciate if you can tell me the VBA code to fix the problem, thanks.

  4. #4
    stmoong is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    Hi kamran, it might be useful for you to learn about programming and simple queries if you want to do this. I don't think it's right for me to type the code for you.

    Here's a link to get started: http://www.functionx.com/vbaccess/

    Also, use the built-in help file (can be accessed in VB Editor by pressing F1), and also MSDN for reference to the various API.

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

Similar Threads

  1. Replies: 3
    Last Post: 10-08-2012, 08:40 AM
  2. Replies: 8
    Last Post: 09-27-2012, 11:12 AM
  3. save record in 2 table
    By smahdih in forum Forms
    Replies: 2
    Last Post: 11-13-2011, 12:51 AM
  4. Replies: 8
    Last Post: 05-12-2011, 06:11 PM
  5. save last record in table through a form
    By ajetrumpet in forum Forms
    Replies: 3
    Last Post: 09-09-2010, 08:53 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