Help Refreshing a Form

S

Scottie

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top