I have a Form that opens on start up. The form imports from a text file and transfers info. I have a command button on the form when it is pressed... the form load procedure fires again and imports the info again. I do not want this to happen. Hwo can I prevent the form load from running when I clcik a button.
On Error Resume Next
FileCopy "\\Jcksn1a1\Common\295097\Settlement_Form\Settlement_i.mdb", "C:\Settlement_i.mdb"
DoCmd.SetWarnings (0)
Me.cmdSubmit.Visible = False
Me.cmdCancel.Visible = False
Me.Combo8.Visible = False
Me.lblName.Visible = False
Me.lblTitle.Visible = True
On Error Resume Next
DoCmd.TransferText acImportDelim, "SText", "tblRaw_Settlement_Info", "G:\295097\Settlement_Form\SText.txt", 0 'import from text file
DoCmd.RunSQL "SELECT * INTO tblSettlement_Info FROM tblRaw_Settlement_Info" ' dump n2 tmp table
DoCmd.DeleteObject acTable, "tblRaw_Settlement_Info"
DoCmd.DeleteObject acTable, "SText_ImportErrors"
On Error Resume Next
FileCopy "\\Jcksn1a1\Common\295097\Settlement_Form\Settlement_i.mdb", "C:\Settlement_i.mdb"
DoCmd.SetWarnings (0)
Me.cmdSubmit.Visible = False
Me.cmdCancel.Visible = False
Me.Combo8.Visible = False
Me.lblName.Visible = False
Me.lblTitle.Visible = True
On Error Resume Next
DoCmd.TransferText acImportDelim, "SText", "tblRaw_Settlement_Info", "G:\295097\Settlement_Form\SText.txt", 0 'import from text file
DoCmd.RunSQL "SELECT * INTO tblSettlement_Info FROM tblRaw_Settlement_Info" ' dump n2 tmp table
DoCmd.DeleteObject acTable, "tblRaw_Settlement_Info"
DoCmd.DeleteObject acTable, "SText_ImportErrors"