none
ADD NEW RECORDS RRS feed

  • Question

  • Dear Sir,

     

    I created an Add New command on the form to add records to a table.  It was working fine till I close the file.  Once I reopen the file and try to add the records, I cannot do it.

     

    Please help me

     

     

    Thanks & Best Regards,

     

    Krishna

    Tuesday, August 30, 2011 2:48 PM

Answers

  • Office Button / Access Options  / Security Center  / click on  the button Security Center Options on  the right

    (I'm not sure the title is exactly that, I'm using the italian loclized version so  I don't know the exact translation used)

    Click on Thrusted locations (Second option on the left menu)   Clic on Add New location  on the button at the bottom of the window,  select the path , click on OK  to close all the window, close the database and reopen it.

     

     


    Cinzia


    Sito RIO
    Il mio Blog
    • Marked as answer by KPALAR Friday, September 2, 2011 8:06 AM
    Friday, September 2, 2011 7:53 AM

All replies

  • What is the actual error message?
    jmh
    Tuesday, August 30, 2011 3:01 PM
  • Message body

    Dear,  Thanks for the reply.

    No error message.

    But, After I create a file and continue with that it works till I close the file.
    When I continue with that file after reopening it, it doesn't work.

    Any settings are there in office 2007 ?
    Tuesday, August 30, 2011 3:32 PM
  • Your request is extremely vague, so it is almost impossible to provide any helpful information. What is actually happening? Provide some detail.
    jmh
    Tuesday, August 30, 2011 3:59 PM
  • Dear

    1. I created a table with 4 fields

    2. I created a form by design mode with 4 text boxes and a command button

    3. Using VB code, I am able to add the records(Till I close the file)

    4. After reopening the file, I am not able to add the records(I tried by creating many files)

    Note: Kindly note that I have created a database using the same mathod in older version of MS Access, but noton MS Access 2007

    Please.....

     

    Tuesday, August 30, 2011 4:15 PM
  • Ok, that is helpful. I'm still confused on item 4, though. What specifically does not work? What is the actual code you are using to add records to the table?
    jmh
    Tuesday, August 30, 2011 4:44 PM

  • Dear, I am copying the code below:  (The name of table is: base)

     

    Private Sub Command8_Click()
    Dim db As Database

    Dim rs As Recordset
    Set db = CurrentDb
    Set rs = db.OpenRecordset("base", 2)
    rs.AddNew

    rs(0) = Val(Text0.Value)
    rs(1) = Text2
    rs(2) = Text4
    rs(3) = Text6
    rs.Update
    Text0.SetFocus

    Text0 = ""
    Text2 = ""
    Text4 = ""
    Text6 = ""

     

    End Sub

    Tuesday, August 30, 2011 4:51 PM
  • So you are saying you:

    1. Close the database
    2. Open the database
    3. Open the form
    4. Put values in the text boxes
    5. Click Command8

    ...and the record is not added to the table called base? If you are viewing the table at the same time as the form, make sure you hit F5 while viewing the table to refresh the view of the table after adding rows in the form. Likewise you could close the table and reopen the table.


    jmh
    Tuesday, August 30, 2011 5:11 PM
  • Here's what I mean about refresh.

    I have both the form and the table open. I have already added two rows through the form, and am about to add a third. However, the table does not show any rows. This is because the view of table does not automatically update:

    To show the new rows, I must

    1. Click on the table window (or tab, if you're viewing in tabbed view format)
    2. Press F5

    Now the table view refreshes and shows all three rows I have added:


    jmh
    Tuesday, August 30, 2011 5:19 PM
  • Dear,

    I have tried all the methods, But no use.

    Is there any settings in the "Access Options"  or any other sections, to be done?

    Please.......

     

     

    Tuesday, August 30, 2011 5:24 PM
  • Dear All,

     

    Could you help me out to resolve my problem, please...

     

    Friday, September 2, 2011 7:08 AM
  • Hi,

    Have you added the folder where the database is in, to the Trusted Locations, in Access options, Security center?


    Cinzia


    Sito RIO
    Il mio Blog
    Friday, September 2, 2011 7:19 AM
  • Dear,

     

    Kindly advice me how to do that?

     

    Friday, September 2, 2011 7:24 AM
  • Office Button / Access Options  / Security Center  / click on  the button Security Center Options on  the right

    (I'm not sure the title is exactly that, I'm using the italian loclized version so  I don't know the exact translation used)

    Click on Thrusted locations (Second option on the left menu)   Clic on Add New location  on the button at the bottom of the window,  select the path , click on OK  to close all the window, close the database and reopen it.

     

     


    Cinzia


    Sito RIO
    Il mio Blog
    • Marked as answer by KPALAR Friday, September 2, 2011 8:06 AM
    Friday, September 2, 2011 7:53 AM
  • IT WORKS NOW.

     

    THANK YOU VERY MUCH

     

    Friday, September 2, 2011 8:07 AM