Arka planı zaten yapamadım sorun değil o zaten.
Neden başka forumlara gif eklemek zorunda kalıyoruz konu taşınınca
Hayırlı Kandiller bu arada abey.
Option Compare Database
Private Sub Form_Load()
Dim ctl As Control
For Each ctl In Me.Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox 'TextBox ve ComboBox icin
If ctl.Tag = "degistiginde" Then
ctl.OnChange = "=Degisti([" & ctl.Name & "])"
ctl.OnGotFocus = "=ArdRenk([" & ctl.Name & "])"
ctl.OnLostFocus = "=ArdRenkCik([" & ctl.Name & "])"
End If
Case acCommandButton 'CommandButton ve TextBox ve ComboBox icin
If ctl.Tag = "degistiginde" Then
ctl.OnGotFocus = "=ArdRenk([" & ctl.Name & "])"
ctl.OnLostFocus = "=ArdRenkCik([" & ctl.Name & "])"
End If
Case acOptionButton 'OptionButton icin
If ctl.Tag = "degistiginde" Then
ctl.OnGotFocus = "=ArdSec1([" & ctl.Name & "])"
End If
Case acCheckBox 'CheckBox icin
If ctl.Tag = "degistiginde" Then
ctl.Value = False
ctl.OnLostFocus = "=ArdSecCik2([" & ctl.Name & "])" 'CheckBox icin
End If
End Select
Next ctl
End Sub
Public Function Degisti(ctl As Control) 'TextBox ve ComboBox icin
Me.Metin0 = Empty
For Each ctl In Me.Controls
If ctl.Tag = "degistiginde" Then
If ctl.Name = ActiveControl.Name Then
Me.Metin0 = ctl.Text
End If
End If
Next ctl
End Function
Public Function ArdRenk(ctl As Control) 'TextBox ve ComboBox ve CommandButton icin
ctl.BackColor = vbGreen
End Function
Public Function ArdRenkCik(ctl As Control) 'TextBox ve ComboBox ve CommandButton icin
ctl.BackColor = vbWhite
End Function
Public Function ArdSec1(ctl As Control) 'OptionButton icin
MsgBox ctl.Name
End Function
Public Function ArdSecCik2(ctl As Control) 'CheckBox icin
ctl.Value = False
End Function