Wenn ihr euch für eine gute Antwort bedanken möchtet, im entsprechenden Posting einfach den Knopf "sag Danke" drücken!
Option Compare Database
Option Explicit
Private Sub Form_Load()
' Hilfsfunktion hinzufügen
If IsFormLoaded("frmVokabelTrainer") Then
Me.Move Left:=9000, Top:=1000, Width:=7000, Height:=5000
End If
End Sub
' Hilfsfunktion außerhalb des Form_Load einfügen
Function IsFormLoaded(FormName As String) As Boolean
Dim frm As Form
On Error Resume Next
Set frm = Forms(FormName)
IsFormLoaded = (Err.Number = 0)
On Error GoTo 0
End Function
' Fügt das Zeichen an der aktuellen Cursorposition im Textfeld txtAntwort auf frmVokabelTrainer ein
Private Sub ZeichenEingeben(ByVal s As String)
Dim txt As Control
Set txt = Forms!frmVokabelTrainer!txtAntwort
Dim curText As String
curText = txt.Text
Dim pos As Long
pos = txt.SelStart
Dim newText As String
newText = Left(curText, pos) & s & Mid(curText, pos + 1)
txt.Text = newText
txt.SelStart = pos + Len(s)
txt.SelLength = 0
txt.setFocus
End Sub
Private Sub btnD_Click()
Dim txt As Control '?
Call ZeichenEingeben(ChrW(272)) ' Ð
End Sub
Private Sub btn_d_Click()
Call ZeichenEingeben(ChrW(273)) ' d
End Sub
Private Sub btnCC_Click()
Call ZeichenEingeben(ChrW(268)) ' C
End Sub
Private Sub btn_cc_Click()
Call ZeichenEingeben(ChrW(269)) ' c
End Sub
Private Sub btnS_Click()
Call ZeichenEingeben(ChrW(352)) ' Š
End Sub
Private Sub btn_s_Click()
Call ZeichenEingeben(ChrW(353)) ' š
End Sub
Private Sub btnC_Click()
Call ZeichenEingeben(ChrW(262)) ' C
End Sub
Private Sub btn_c_Click()
Call ZeichenEingeben(ChrW(263)) ' c
End Sub
Private Sub btnZ_Click()
Call ZeichenEingeben(ChrW(381)) ' Ž
End Sub
Private Sub btn_z_Click()
Call ZeichenEingeben(ChrW(382)) ' ž
End Sub
Public Function BackcolorOn() As Variant
On Error Resume Next
Screen.ActiveControl.BackColor = QBColor(14) 'Hellgelb
End Function
Private Sub ST_Titel_GotFocus()
BackcolorOn
End Sub
Public Function BackcolorOn(ctlTextbox As Access.TextBox)
ctlTextBox.BackColor = QBColor(14) 'Hellgelb
End Function