Skip to main content
Post Undeleted by Neymar0001
Post Deleted by Neymar0001
deleted 123 characters in body
Source Link
Neymar0001
  • 25
  • 1
  • 1
  • 8

@Akina thank you so much for your help! I pasted this Code in MS Access Module Editor, and did some modifications because I got some error Messages. The newest error essage is: RuntimeThis code runs without an error '424', but doesn't do anything. Object required. I paste the slightly modified Code here. I may have made some stupid mistakes…

Option Compare Database

Function Macro1()
Dim tmp As String, temp() As String
'Dim rs - opened recordset to data table
FunctionAs Macro1()Recordset
Open "J:\80_Applications\SAPGuiScripting\01_TXT_Files\CM01_Total\80_Applications\SAPGuiScripting\01_TXT_Files\CM01_Total_1.csv"txt" For Input As #1
Set rs = CurrentDb.OpenRecordset("CM01_Total_1")
Do Until EOF(1)
  Line Input #1, tmp
  If Left(tmp, 12) = "Arbeitsplatz" Then num = Val(Mid(tmp, 17))
  If InStr(tmp, "|") > 0 And InStr(tmp, "Woche") = 0 Then
    temp = Split(tmp, "|")
    With rs
      .AddNew
      !Arbeitsplatz = num
      !Woche = temp(1)
      !Bedarf = temp(2)
      !Angebot = temp(3)
      !Belast = temp(4)
      !freie_Kap[freie Kap] = temp(5)
      !Einh = temp(6)
      .Update
    End With
  End If
Loop
Close #1
rs.Close
Set rs = Nothing
End Function

@Akina thank you so much for your help! I pasted this Code in MS Access Module Editor, and did some modifications because I got some error Messages. The newest error essage is: Runtime error '424'. Object required. I paste the slightly modified Code here. I may have made some stupid mistakes…

Dim tmp As String, temp() As String
' rs - opened recordset to data table
Function Macro1()
Open "J:\80_Applications\SAPGuiScripting\01_TXT_Files\CM01_Total.csv" For Input As #1
Do Until EOF(1)
  Line Input #1, tmp
  If Left(tmp, 12) = "Arbeitsplatz" Then num = Val(Mid(tmp, 17))
  If InStr(tmp, "|") > 0 And InStr(tmp, "Woche") = 0 Then
    temp = Split(tmp, "|")
    With rs
      .AddNew
      !Arbeitsplatz = num
      !Woche = temp(1)
      !Bedarf = temp(2)
      !Angebot = temp(3)
      !Belast = temp(4)
      !freie_Kap = (5)
      !Einh = temp(6)
      .Update
    End With
  End If
Loop
Close #1
End Function

This code runs without an error, but doesn't do anything...

Option Compare Database

Function Macro1()
Dim tmp As String, temp() As String
Dim rs As Recordset
Open "J:\80_Applications\SAPGuiScripting\01_TXT_Files\CM01_Total_1.txt" For Input As #1
Set rs = CurrentDb.OpenRecordset("CM01_Total_1")
Do Until EOF(1)
  Line Input #1, tmp
  If Left(tmp, 12) = "Arbeitsplatz" Then num = Val(Mid(tmp, 17))
  If InStr(tmp, "|") > 0 And InStr(tmp, "Woche") = 0 Then
    temp = Split(tmp, "|")
    With rs
      .AddNew
      !Arbeitsplatz = num
      !Woche = temp(1)
      !Bedarf = temp(2)
      !Angebot = temp(3)
      !Belast = temp(4)
      ![freie Kap] = temp(5)
      !Einh = temp(6)
      .Update
    End With
  End If
Loop
Close #1
rs.Close
Set rs = Nothing
End Function
Source Link
Neymar0001
  • 25
  • 1
  • 1
  • 8

@Akina thank you so much for your help! I pasted this Code in MS Access Module Editor, and did some modifications because I got some error Messages. The newest error essage is: Runtime error '424'. Object required. I paste the slightly modified Code here. I may have made some stupid mistakes…

Dim tmp As String, temp() As String
' rs - opened recordset to data table
Function Macro1()
Open "J:\80_Applications\SAPGuiScripting\01_TXT_Files\CM01_Total.csv" For Input As #1
Do Until EOF(1)
  Line Input #1, tmp
  If Left(tmp, 12) = "Arbeitsplatz" Then num = Val(Mid(tmp, 17))
  If InStr(tmp, "|") > 0 And InStr(tmp, "Woche") = 0 Then
    temp = Split(tmp, "|")
    With rs
      .AddNew
      !Arbeitsplatz = num
      !Woche = temp(1)
      !Bedarf = temp(2)
      !Angebot = temp(3)
      !Belast = temp(4)
      !freie_Kap = (5)
      !Einh = temp(6)
      .Update
    End With
  End If
Loop
Close #1
End Function