hi,
I don't know what's wrong, or why this is happening.
I have a form where a user selects several combo boxes, and then clicks a button. This in turn inserts the user's selections into a table.
My problem is this: the code works, but it inserts a blank row before the actual data. It happens only the first time the user tries to insert data (if they don't close the form and keep inserting more, no blank lines appear - except the first one).
Does anyone know why?
Here is the code behind the button:
Appreciate any help you can give me.
thanks!
I don't know what's wrong, or why this is happening.
I have a form where a user selects several combo boxes, and then clicks a button. This in turn inserts the user's selections into a table.
My problem is this: the code works, but it inserts a blank row before the actual data. It happens only the first time the user tries to insert data (if they don't close the form and keep inserting more, no blank lines appear - except the first one).
Does anyone know why?
Here is the code behind the button:
Code:
'Copy the file to the specified folder in the Transfer Drive
Set filesys = CreateObject("Scripting.FileSystemObject")
'Check if file exists, if it does, copy file to appropriate folder
If filesys.FileExists(txtPath) Then
filesys.CopyFile txtPath, destPath
MsgBox "File Upload Successful."
'Insert values into main log
stSQL = "INSERT INTO tblMainLog(LogID, SequenceID, Project, Company) VALUES ('" & tmpLogID & "', '" & sequenceNo & "', '" & Nz(Me![txtProject], 0) & "' , '" & Nz(Me![txtContractor], 0)"')"
CurrentDb.Execute (stSQL) 'Execute the SQL-query
Else
MsgBox "File Not Found. The file you are trying to upload cannot be found.", vbOKOnly, "File Not Found!"
End If
Appreciate any help you can give me.
thanks!