Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Help Refreshing a Form

Discussion in 'Information Technology' started by Scottie, Nov 19, 2005.

  1. Scottie

    Scottie
    Expand Collapse
    Guest

    I have a form that I use to input data. I open the form by clicking on
    button on my Switchboard. 5 fields total - 4 drop down boxes and 1
    memo box for comments. I have added a close button to the form.
    Included in the close button are commands to run an append query to a
    linked table on my SQL Server and a delete query to clear the local
    table that is being used to house the data locally on a temporary
    basis. The button works fine the first time that I use it. I input
    the data and then queries run successfully (messages appear asking if I
    want to run the queries.). The form then closes. I reopen the form
    from a button on the switchboard and enter a new data in the fields.
    When I click on the button to close the form, it proceeds to tell me
    that it has 0 records to apppend and consequently 0 records to delete.
    I have attached some code. Can you help?!!!!

    rivate Sub Exit_Click()
    On Error GoTo Err_Exit_Click
    DoCmd.OpenQuery "qryAppendDailyContacts", [acViewNormal], [acReadOnly]

    DoCmd.OpenQuery "qryDeleteDailyContacts", [acViewNormal], [acReadOnly]




    DoCmd.Close


    Exit_Exit_Click:
    Exit Sub

    Err_Exit_Click:
    MsgBox Err.Description
    Resume Exit_Exit_Click

    End Sub

    Private Sub Form_Load()
    Forms!DailyContacts!Date = ""
    Forms!DailyContacts!PASTeamMember = ""
    Forms!DailyContacts!Contact = ""
    Forms!DailyContacts!Element = ""
    Forms!DailyContacts!Comments = ""

    End Sub
     
  2. Loading...


Share This Page