Originally Posted by
June7
I found other idea but somethig works wrong.
I have code to import one file like this:
Code:
DoCmd.SetWarnings FalseConst acAppendData = 2
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase "C:\path\xml.accdb"
objAccess.ImportXML "" & Me.lstFileList.Value & "", acAppendData
DoCmd.RunSQL "UPDATE TAB1 SET [IDTMP] = '" & Me.Tekst6.Value & "' WHERE [ID] is null ;"
.
This part
Code:
objAccess.ImportXML "" & Me.lstFileList.Value & "", acAppendData.
import files which are listed from call function. This works great. Field [IDTMP] is empty and I need update it with this sql
Code:
DoCmd.RunSQL "UPDATE TABELA SET [IDTMP] = '" & Me.Tekst6.Value & "' WHERE [ID] is null ;".
And now is problem.Between this two parts of code import and update access can't refresh table TAB1 and update doesn't work. Sometimes works and updates field [IDTEMP]. Sometimes when I import next xml file updates record for first file, sometimes updates two records with the same Me.Tekst6.Value.
Probably is something wrong with refresh table.
One more. If I share import and update for two different button and use after import system button "Refresh all" and update sql everything works great.What is wrong ?