Op een oude pc met Windows XP stond een factureer programmaatje wat geschreven is in Virtual basic 6.
Deze moest ik op een nieuwe pc zetten met Windows 10 erop.
Vele meldingen heb ik op kunnen lossen maar de volgende melding niet.
Cant open clipboard (foutcode 521)
Dit gebeurt bij dit blad als je produckten moet selecteren (plus aantal) voor een rekening.
Na het invoeren van BV 1x boven prothese 1x boormal (implantaat)incl model gaat het nog goed maar bij de derde invoer geeft hij de melding en sluit deze het programma.
Als ik dan die weer opstart en het weer probeer geeft hij de melding al soms bij de eerste invoer.
Ik zat zelf te denken dat het klembord vol is of niet wordt overschreven of zoiets maar de oplossing kan ik hier nog niet voor vinden.
Ik hoop jullie wel.
Hieronder de code die bij dit blad hoort.
Gr. Jan
Deze moest ik op een nieuwe pc zetten met Windows 10 erop.
Vele meldingen heb ik op kunnen lossen maar de volgende melding niet.
Cant open clipboard (foutcode 521)
Dit gebeurt bij dit blad als je produckten moet selecteren (plus aantal) voor een rekening.
Na het invoeren van BV 1x boven prothese 1x boormal (implantaat)incl model gaat het nog goed maar bij de derde invoer geeft hij de melding en sluit deze het programma.
Als ik dan die weer opstart en het weer probeer geeft hij de melding al soms bij de eerste invoer.
Ik zat zelf te denken dat het klembord vol is of niet wordt overschreven of zoiets maar de oplossing kan ik hier nog niet voor vinden.
Ik hoop jullie wel.
Hieronder de code die bij dit blad hoort.
Code:
Private Sub cmdEinde_Click()
'leeghalen tekstvelden
TextA1.Text = ""
Text1.Text = ""
TextA2.Text = ""
Text2.Text = ""
TextA3.Text = ""
Text3.Text = ""
TextA4.Text = ""
Text4.Text = ""
TextA5.Text = ""
Text5.Text = ""
TextA6.Text = ""
Text6.Text = ""
TextA7.Text = ""
Text7.Text = ""
TextA8.Text = ""
Text8.Text = ""
TextA9.Text = ""
Text9.Text = ""
TextA10.Text = ""
Text10.Text = ""
cmdZoeken1.Enabled = True
cmdZoeken2.Enabled = True
cmdZoeken3.Enabled = False
cmdSelecteren.Enabled = False
cmdPrintenBon.Enabled = False
opdrachtbon.WindowState = 0
opdrachtbon.Hide
hoofdform_opdrachtbon.Show
End Sub
Private Sub cmdHoofdmenu_Click()
opdrachtbon.Hide
TTLAccount.Show
End Sub
Private Sub cmdPlaatsen_Click()
SearchStr$ = comboNaam
tandartsen.Recordset.Index = "Naam"
tandartsen.Recordset.Seek "=", SearchStr$
comboNaam.Clear
comboNaam.Visible = False
cmdPlaatsen.Visible = False
cmdZoeken1.Enabled = False
cmdZoeken2.Enabled = False
cmdZoeken3.Enabled = True
End Sub
Private Sub cmdPrintenBon_Click()
Dim sql As String
Set db = OpenDatabase("c:\TTL Account\TTLAccount.mdb")
Dim s1 As Recordset
Dim s2 As Recordset
Dim s3 As Recordset
Dim aantal
Dim totaal
Dim o '= omschrijving
Dim a '= aantal
Dim p '= prijs
Dim t '= tandarts
Dim n '= nummer bon
Dim k '= kortingspercentage
opdrachtbon.Hide
evenwachten.Show
t = "t" & txtNummerTandarts.Text
n = txtNummerOpdrachtbon.Text
totaal = 0
notas.UpdateRecord
DoEvents
sql = "select * from notas where notanr = " & n & " "
Set s1 = db.OpenRecordset(sql, dbOpenSnapshot)
Do While Not s1.BOF And Not s1.EOF
o = s1!artikel
a = s1!aantal
sql = "select * from artikel where Omschrijving = '" & o & "' "
Set s2 = db.OpenRecordset(sql, dbOpenSnapshot)
DoEvents
p = s2!Prijs
DoEvents
sql = "select " & t & " from artikel where Omschrijving = '" & o & "' "
Set s3 = db.OpenRecordset(sql, dbOpenSnapshot)
DoEvents
k = s3.Fields(t).Value
If k = 0 Then
bedr = p * a
Else
bedr = (p * a) / 100 * (100 - k)
End If
pp = Int(bedr * 100) / 100
totaal = totaal + pp
'evt hier ook zonder korting uit laten rekenen
s1.MoveNext
Loop
db.Close
'vullen faktuur in mdb
fakturen.Recordset.AddNew
numt = txtNummerTandarts.Text
txtTussen3.DataField = "num_tandarts"
txtTussen3.Text = numt
nmm = txtMaand.Text
txtTussen4.DataField = "nm_maand"
txtTussen4.Text = nmm
nmp = txtNaamPatient.Text
txtTussen5.DataField = "nm_patient"
txtTussen5.Text = nmp
notanum = txtNummerOpdrachtbon.Text
txtTussen6.DataField = "notanum"
txtTussen6.Text = notanum
numb = txtNummerBon.Text
txtTussen7.DataField = "num_bon"
txtTussen7.Text = numb
txtTussen8.DataField = "bedrag"
txtTussen8.Text = totaal
fakturen.Recordset.MoveLast
'leeghalen tekstvelden
TextA1.Text = ""
Text1.Text = ""
TextA2.Text = ""
Text2.Text = ""
TextA3.Text = ""
Text3.Text = ""
TextA4.Text = ""
Text4.Text = ""
TextA5.Text = ""
Text5.Text = ""
TextA6.Text = ""
Text6.Text = ""
TextA7.Text = ""
Text7.Text = ""
TextA8.Text = ""
Text8.Text = ""
TextA9.Text = ""
Text9.Text = ""
TextA10.Text = ""
Text10.Text = ""
'sluiten form
cmdZoeken1.Enabled = True
cmdZoeken2.Enabled = True
cmdZoeken3.Enabled = False
cmdSelecteren.Enabled = False
cmdPrintenBon.Enabled = False
opdrachtbon.WindowState = 0
'naar Word
Dim WordObj As Object
On Error GoTo maken
Set WordObj = GetObject(, "Word.Application")
WordObj.Documents.Open "c:\ttl account\opdrachtbon.doc"
WordObj.Visible = False
WordObj.Documents(1).SaveAs "c:\windows\temp\" & notanum & ""
WordObj.application.Run MacroName:="vullen"
WordObj.Documents(1).SaveAs "c:\ttl account\bonnen\" & notanum & " - " & nmp & " - " & nmm & ".doc"
WordObj.Documents(1).Close
' Dim objWordApp As Object
' Set objWordApp = GetObject("", "Word.Application")
' If objWordApp Is Nothing Then
' Set objWordApp = CreateObject("Word.Application")
' End If
' objWordApp.Documents.Open "c:\ttl account\opdrachtbon.doc"
' objWordApp.Visible = False
' objWordApp.Documents(1).SaveAs "c:\windows\temp\" & notanum & ""
' objWordApp.application.Run MacroName:="vullen"
' objWordApp.Documents(1).SaveAs "c:\ttl account\bonnen\" & notanum & " - " & nmp & " - " & nmm & ".doc"
' objWordApp.Documents(1).Close
' objWordApp.Quit
evenwachten.Hide
hoofdform_opdrachtbon.Show
Exit Sub
maken:
Set WordObj = CreateObject("Word.Application")
Err.Clear
Resume Next
End Sub
Private Sub cmdSelecteren_Click()
For x% = 0 To List1.ListCount - 1
If List1.Selected(x%) = True Then
If Text1 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text1.DataField = "artikel"
TextA1.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text1.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA1.Text = aant
notas.Recordset.MoveLast
Text1.DataField = ""
TextA1.DataField = ""
ElseIf Text2 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text2.DataField = "artikel"
TextA2.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text2.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA2.Text = aant
notas.Recordset.MoveLast
Text2.DataField = ""
TextA2.DataField = ""
ElseIf Text3 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text3.DataField = "artikel"
TextA3.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text3.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA3.Text = aant
notas.Recordset.MoveLast
Text3.DataField = ""
TextA3.DataField = ""
ElseIf Text4 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text4.DataField = "artikel"
TextA4.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text4.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA4.Text = aant
notas.Recordset.MoveLast
Text4.DataField = ""
TextA4.DataField = ""
ElseIf Text5 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text5.DataField = "artikel"
TextA5.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text5.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA5.Text = aant
notas.Recordset.MoveLast
Text5.DataField = ""
TextA5.DataField = ""
ElseIf Text6 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text6.DataField = "artikel"
TextA6.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text6.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA6.Text = aant
notas.Recordset.MoveLast
Text6.DataField = ""
TextA6.DataField = ""
ElseIf Text7 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text7.DataField = "artikel"
TextA7.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text7.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA7.Text = aant
notas.Recordset.MoveLast
Text7.DataField = ""
TextA7.DataField = ""
ElseIf Text8 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text8.DataField = "artikel"
TextA8.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text8.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA8.Text = aant
notas.Recordset.MoveLast
Text8.DataField = ""
TextA8.DataField = ""
ElseIf Text9 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text9.DataField = "artikel"
TextA9.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text9.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA9.Text = aant
notas.Recordset.MoveLast
Text9.DataField = ""
TextA9.DataField = ""
ElseIf Text10 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text10.DataField = "artikel"
TextA10.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text10.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA10.Text = aant
notas.Recordset.MoveLast
Text10.DataField = ""
TextA10.DataField = ""
ElseIf Text11 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text11.DataField = "artikel"
TextA11.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text11.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA11.Text = aant
notas.Recordset.MoveLast
Text11.DataField = ""
TextA11.DataField = ""
ElseIf Text12 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text12.DataField = "artikel"
TextA12.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text12.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA12.Text = aant
notas.Recordset.MoveLast
Text12.DataField = ""
TextA12.DataField = ""
ElseIf Text13 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text13.DataField = "artikel"
TextA13.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text13.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA13.Text = aant
notas.Recordset.MoveLast
Text13.DataField = ""
TextA13.DataField = ""
ElseIf Text14 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text14.DataField = "artikel"
TextA14.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text14.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA14.Text = aant
notas.Recordset.MoveLast
Text14.DataField = ""
TextA14.DataField = ""
ElseIf Text15 = "" Then
Clipboard.Clear
notas.Recordset.AddNew
Text15.DataField = "artikel"
TextA15.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text15.Text = List1.List(x%)
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA15.Text = aant
notas.Recordset.MoveLast
Text15.DataField = ""
TextA15.DataField = ""
End If
End If
Next x%
Clipboard.SetText txtNummerOpdrachtbon.Text
txtTussen1.Text = Clipboard.GetText()
Clipboard.SetText txtNummerTandarts.Text
txtTussen2.Text = Clipboard.GetText()
cmdPrintenBon.Enabled = True
End Sub
Private Sub cmdZoeken1_Click()
prompt$ = "Geef het nummer in."
SearchStr$ = InputBox(prompt$)
tandartsen.Recordset.Index = "Nummer"
tandartsen.Recordset.Seek "=", SearchStr$
If tandartsen.Recordset.NoMatch Then
tandartsen.Recordset.MoveFirst
End If
cmdZoeken1.Enabled = False
cmdZoeken2.Enabled = False
cmdZoeken3.Enabled = True
cmdSelecteren.Enabled = True
End Sub
Private Sub cmdZoeken2_Click()
comboNaam.Visible = True
cmdPlaatsen.Visible = True
Dim sql As String
Dim omschr As Recordset
Set db = OpenDatabase("c:\TTL Account\TTLAccount.mdb")
DoEvents
sql = "select naam from gegevens where naam <> '0'" & "order by naam asc;"
Set nm = db.OpenRecordset(sql, dbOpenSnapshot)
Do While Not nm.BOF And Not nm.EOF
comboNaam.AddItem nm!naam
DoEvents
nm.MoveNext
Loop
db.Close
cmdSelecteren.Enabled = True
End Sub
Private Sub cmdZoeken3_Click()
prompt$ = "Geef de artikelcode in."
SearchStr$ = InputBox(prompt$)
artikelen.Recordset.Index = "Artikelcode"
artikelen.Recordset.Seek "=", SearchStr$
If artikelen.Recordset.NoMatch Then
Beep
Else
txtTussen.DataField = "Omschrijving"
Clipboard.SetText txtTussen.Text
If Text1 = "" Then
notas.Recordset.AddNew
Text1.DataField = "artikel"
TextA1.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text1.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA1.Text = aant
notas.Recordset.MoveLast
Text1.DataField = ""
TextA1.DataField = ""
ElseIf Text2 = "" Then
notas.Recordset.AddNew
Text2.DataField = "artikel"
TextA2.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text2.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA2.Text = aant
notas.Recordset.MovePrevious
notas.Recordset.MoveLast
Text2.DataField = ""
TextA2.DataField = ""
ElseIf Text3 = "" Then
notas.Recordset.AddNew
Text3.DataField = "artikel"
TextA3.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text3.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA3.Text = aant
notas.Recordset.MoveLast
Text3.DataField = ""
TextA3.DataField = ""
ElseIf Text4 = "" Then
notas.Recordset.AddNew
Text4.DataField = "artikel"
TextA4.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text4.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA4.Text = aant
notas.Recordset.MoveLast
Text4.DataField = ""
TextA4.DataField = ""
ElseIf Text5 = "" Then
notas.Recordset.AddNew
Text5.DataField = "artikel"
TextA5.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text5.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA5.Text = aant
notas.Recordset.MoveLast
Text5.DataField = ""
TextA5.DataField = ""
ElseIf Text6 = "" Then
notas.Recordset.AddNew
Text6.DataField = "artikel"
TextA6.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text6.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA6.Text = aant
notas.Recordset.MoveLast
Text6.DataField = ""
TextA6.DataField = ""
ElseIf Text7 = "" Then
notas.Recordset.AddNew
Text7.DataField = "artikel"
TextA7.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text7.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA7.Text = aant
notas.Recordset.MoveLast
Text7.DataField = ""
TextA7.DataField = ""
ElseIf Text8 = "" Then
notas.Recordset.AddNew
Text8.DataField = "artikel"
TextA8.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text8.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA8.Text = aant
notas.Recordset.MoveLast
Text8.DataField = ""
TextA8.DataField = ""
ElseIf Text9 = "" Then
notas.Recordset.AddNew
Text9.DataField = "artikel"
TextA9.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text9.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA9.Text = aant
notas.Recordset.MoveLast
Text9.DataField = ""
TextA9.DataField = ""
ElseIf Text10 = "" Then
notas.Recordset.AddNew
Text10.DataField = "artikel"
TextA10.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text10.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA10.Text = aant
notas.Recordset.MoveLast
Text10.DataField = ""
TextA10.DataField = ""
ElseIf Text11 = "" Then
notas.Recordset.AddNew
Text11.DataField = "artikel"
TextA11.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text11.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA11.Text = aant
notas.Recordset.MoveLast
Text11.DataField = ""
TextA11.DataField = ""
ElseIf Text12 = "" Then
notas.Recordset.AddNew
Text12.DataField = "artikel"
TextA12.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text12.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA12.Text = aant
notas.Recordset.MoveLast
Text12.DataField = ""
TextA12.DataField = ""
ElseIf Text13 = "" Then
notas.Recordset.AddNew
Text13.DataField = "artikel"
TextA13.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text13.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA13.Text = aant
notas.Recordset.MoveLast
Text13.DataField = ""
TextA13.DataField = ""
ElseIf Text14 = "" Then
notas.Recordset.AddNew
Text14.DataField = "artikel"
TextA14.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text14.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA14.Text = aant
notas.Recordset.MoveLast
Text14.DataField = ""
TextA14.DataField = ""
ElseIf Text15 = "" Then
notas.Recordset.AddNew
Text15.DataField = "artikel"
TextA15.DataField = "aantal"
txtTussen1.DataField = "notanr"
txtTussen2.DataField = "tandarts"
Text15.Text = Clipboard.GetText()
prompt$ = "aantal:"
aant = InputBox(prompt$, , 1)
TextA15.Text = aant
notas.Recordset.MoveLast
Text15.DataField = ""
TextA15.DataField = ""
End If
Clipboard.SetText txtNummerOpdrachtbon.Text
txtTussen1.Text = Clipboard.GetText()
Clipboard.SetText txtNummerTandarts.Text
txtTussen2.Text = Clipboard.GetText()
cmdPrintenBon.Enabled = True
End If
End Sub
Private Sub Form_Load()
Dim sql As String
Dim omschr As Recordset
Set db = OpenDatabase("c:\TTL Account\TTLAccount.mdb")
DoEvents
sql = "select omschrijving from artikel where omschrijving <> '0'" & "order by omschrijving asc;"
Set omschr = db.OpenRecordset(sql, dbOpenSnapshot)
Do While Not omschr.BOF And Not omschr.EOF
List1.AddItem omschr!omschrijving
DoEvents
omschr.MoveNext
Loop
db.Close
opdrachtbon.WindowState = 2
End Sub
Gr. Jan