17-07-2009, 20:28
(En son düzenleme: 18-07-2009, 14:43 Mehmet Eser.)
Aşağıdaki kod ile VT'deki tüm formların araç çubukları değiştirebilirsiniz. En iyisi her VT için yönetim paneli oluşturulması.
Burdaki kod plain'le başlayan formları es geçer, uyarlamayı unutmayınız. Defalarca kullandım, bu koda kefilim. Saniyeler içinde tüm formları siz görmeden değiştiriyor.
Visual Basic
- Public Sub SetFormToolbars()
- Dim objFrm As AccessObject, frm As Form, ctl As Control
- ' Go through every form in the database
- For Each objFrm In CurrentProject.AllForms
- ' Skip fixing any "plain" examples
- If Right(objFrm.Name, 5) <> "plain" Then
- DoCmd.OpenForm FormName:=objFrm.Name, View:=acDesign, WindowMode:=acHidden
- ' Set a pointer to the form just opened
- Set frm = Forms(objFrm.Name)
- ' Set custom menu and toolbars for the form object
- ' .. only for primary forms
- If Left(frm.Name, 3) = "frm" Then
- ' Clear any saved filter while we're at it
- Forms(frm.Name).Filter = ""
- ' Set the custom menu bar
- Forms(frm.Name).MenuBar = "FormMenuBar"
- ' Set the custom toolbar
- Forms(frm.Name).Toolbar = "FormToolbox"
- ' Set the custom shortcut menu bar
- Forms(frm.Name).ShortcutMenuBar = ""
- End If
- ' Loop through all controls
- For Each ctl In frm.Controls
- ' Skip control types that don't have a ShortcutMenuBar property
- If (ctl.ControlType <> acCustomControl) And _
- (ctl.ControlType <> acSubform) And _
- (ctl.ControlType <> acRectangle) And _
- (ctl.ControlType <> acLabel) And _
- (ctl.ControlType <> acLine) And _
- (ctl.ControlType <> acPageBreak) Then
- ' Set the custom control shortcut menu
- ctl.ShortcutMenuBar = ""
- End If
- ' Loop through all controls on the form
- Next ctl
- ' Fix AllowDesignChanges while we're at it
- frm.AllowDesignChanges = False
- ' Close and save the result
- DoCmd.Close acForm, objFrm.Name, acSaveYes
- End If
- ' Loop to get the next form
- Next objFrm
- ' Clean up
- Set ctl = Nothing
- Set frm = Nothing
- Set objFrm = Nothing
- End Sub
Burdaki kod plain'le başlayan formları es geçer, uyarlamayı unutmayınız. Defalarca kullandım, bu koda kefilim. Saniyeler içinde tüm formları siz görmeden değiştiriyor.
VT:Veri Tabanı, AVT: Access VT, MS:Microsoft, Kapaç: Kapa ve aç (rebot ve açkapa saçmalığına çözümüm)
Yazan okuyan sağolsun, çözene saygılar. Kolaylaştırınız, zorlaştırmayınız.? Cinnet geçirmemek için Access 2010'u SP2 ile kullanalım.
? Sürekli sebepsiz hatalar oluyor da AVT uçuyorsa siz de Ofis kurulmunu uçurun çözülüyor. Sorun kurulum dosyanızda! Farklısını bulun!
? VT dağıtıma çıkana kadar bölmek zaman kaybıdır!
{ Veri Tabanı Mantığı } {Access 2010 çökmelerine çözüm } { 60 Günlük Ofis 2010 Pro Türkçe } { Kayıtları Yan Yana Göstermek }
{ Forma Rapora Resim Fotoğraf Eklemek En kolay En Sağlam En Zengin Teknik }



