Results 1 to 5 of 5
  1. #1
    fekrinejat is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    29

    How to Insert an unbound Form into table

    Hello

    I need to use VBA for inserting, form objects values into tables
    Would you tell me how to write vba code ?

    exp: Tbl1(S_ID(PK), S_Name, S_Tel) and Tbl2(T_ID(PK), S_ID(FK), Entry_Date)



    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Simplest would be to create an append query that got the values from the form, and execute it from code. Alternatively, the AddNew method of a recordset. Using unbound forms is much more involved that using bound forms.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    To follow up a bit on Paul's comments: why do you feel you should use an unbound form?

  4. #4
    fekrinejat is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    29
    How can i run a query by vba ? would you give a real samle ?
    actually when i use bound objects, user can see whole the information through its navigaor,
    although i know it can be done easily but i don't want to show it in Form ..

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'd use bound forms, but you can run the query via

    DoCmd.OpenQuery
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 05-18-2012, 02:12 AM
  2. Saving unbound fields on form to table
    By lexygirl in forum Forms
    Replies: 4
    Last Post: 07-25-2011, 10:10 AM
  3. Replies: 5
    Last Post: 03-23-2011, 02:28 PM
  4. Replies: 2
    Last Post: 12-22-2010, 01:46 PM
  5. Replies: 0
    Last Post: 02-24-2010, 12:56 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