VBA - split funktion
Jeg skal have splittet en variabel, som f.eks. kunne væreAZL 923 / GB 4532
Variablen skal splittes i 2 komponenter, dvs. AZL 923 i den ene og GB 4532
Alt til venstre for <space>/<space> skal i strVognNr og alt til højre for <space>/<space> skal i strTrailerNr
Nedenstående kode virker ikke, for strVognNr = AZL og strTrailerNr = 923.
Hvordan skal koden se ud?
If Forms!ordreseddel![BILNR] <> "" Then
If InStr(1, Forms!ordreseddel![BILNR], " / ") <> 0 Then
astrVognTrailerNr = Split(Nz(Forms!ordreseddel![BILNR], " / "))
strVognNr = Nz(astrVognTrailerNr(0))
strTrailerNr = Trim(Nz(astrVognTrailerNr(1)))
End If
End If
