Active X Calendar kontrolunu form uzerinde ilgili text box'a tiklayinca goruntuleme.

Katılım
11 Şubat 2007
Mesajlar
12
Excel Vers. ve Dili
Ms Excel 11.8117.8107 2003 Professional
Selamlar,

Active X Calendar kontrol gercekten cok kullanisli bir tool gibi gorunuyor. Fakat bunu form uzerinde surekli tutmak da gercekten cok cirkin ve oldukca yer kaplayici, gereksiz bir durum. Ayrica form uzerinde 3-4 tane tarih text box u varsa hepsi icin ayri ayri eklemek mi gerekir acaba? ayri ayri ekleme gafletinde bulunsam bile bu kez 3-4 tane text box ait 3-4 tane takvim kontrolunu form uzerinde tasimak imkansiz... (imkanli olsa bile komik/gulunc)

dolayisiyla, bu Active X kontrolunu ilgili text box a tiklayinca nasil goruntuleyebilenecegine dair bilgisi olan arkadaslarin yardimlarini rica ediyorum. Takvim denetimi ile igligil bazi ornekler oldugnu farkettim forumda ama, gerkcekten forumdan indirdigim hicbir access dosyasini calistiramiyorum. o yuzden ekte ilave ettigim access file icin yardimlarinizi rica ediyorum.

cok tesekkuirler simdiden.
 
Katılım
22 Ocak 2007
Mesajlar
815
Excel Vers. ve Dili
2003
cevap

sen yanlış ve çok eski bir takvim denetimi kullanıyon yenisi var datetimepicker diye activex i kullan

senin istediğin görüntüye sahip
 
Katılım
11 Şubat 2007
Mesajlar
12
Excel Vers. ve Dili
Ms Excel 11.8117.8107 2003 Professional
datetimepicker...

cok tesekkurler gulsum...
datetimepicker dedin ve beni google in ellerine biraktin...
sabahtir ariyordum... buldum bir ornek ve kendi basit ornegime uyguladim.
tekrar cok tesekkurler, buyuksun, nediyim.
ornek ekte. buldugum instructionlar da soyle; ihtiyaci olan arkadaslar faydalansin. cok guzel bir takvim denetimi oldu.

Step by Step instructions for how to use the MonthCalendar in your own applications.

Here is a post by fellow Access Developer Jeff Conrad. He has been kind enough to create detailed step by step instructions for the novice Access user.

Hi Dave,

Ok, here are the step-by-step instructions for using Stephen Lebans' MonthCalendar version 9.6.
You may not need to do all the steps; just skip the ones that don't apply.
Download either the 97 or 2000 version from this location:

http://www.lebans.com/monthcalendar.htm


1. Import the five modules (File-->Get External Data-->Import) from the Access 97/2000 demo database into your database.

2. Immediately compile your database before doing anything else! You could introduce several nasty bugs to your database if your Access version(A2K) is not completely patched and up to date so don't skip this step!

3. If you do not know how to compile a database follow these steps:

For Access 97:
- You need to get to any code window. You can do this by either opening any form or module in Design View and click the button on the toolbar that says "Code". Or type Ctrl-G to open the VBA editor
- Then you go up to the toolbar and find the option that says: "Debug."
- From that menu you select "Compile and Save All Modules."

For Access 2000, 2002, 2003:
- You need to get to any code window. You can do this by either opening any form or module in Design View and click the button on the toolbar that says "Code". Or type Ctrl-G to open the VBA editor
- Then you go up to the toolbar and find the option that says: "Debug."
- From that menu you select "Compile <name of your database>."

What this does is go through ALL your code and look for any possible errors. It will immediately stop on any problems it finds. Keep in mind that you may have errors in your database code completely unrelated to Stephen's code. You will need to fix those errors on your own.

4. OK, back to setting up the calendar! Now in your database open any form in design view that you wish to show the calendar. Go to the code window behind the form. In the Declarations area (very top) you need to add this code. So the very first few lines of your code window will look like this:

Option Compare Database
Option Explicit


' This declares the MonthCalendar Class
Private mc As clsMonthCal



5. Now go the Form's Load event and enter this code:

Private Sub Form_Load()

' Create an instance of our Class
Set mc = New clsMonthCal
' Set the hWndForm Property
mc.hWndForm = Me.hWnd

End Sub



6. Now go to the Form's Unload event and enter the following code:

Private Sub Form_Unload(Cancel As Integer)

' This is required in case user Closes Form with the
' Calendar still open. It also handles when the
' user closes the application with the Calendar still open.

If Not mc Is Nothing Then
If mc.IsCalendar Then
Cancel = 1
Exit Sub
End If


Set mc = Nothing
End If

End Sub



7. Now find the CONTROL on the form that you wish to have the calendar fill the date.
Right Click on the control and go to Properties from the list. On the "All" or "Event" tab you should see an option that
says "On Dbl Click". Hit the little (...) button and it will take you to the code window again. We need to add this code:

Private Sub txtSelectDate_DblClick(Cancel As Integer)

Dim blRet As Boolean
Dim dtStart As Date, dtEnd As Date

dtStart = Nz(Me.txtSelectDate.Value, 0)
dtEnd = 0

blRet = ShowMonthCalendar(mc, dtStart, dtEnd)
If blRet = True Then
Me.txtSelectDate = dtStart
Else
' Add any message here if you want to
' inform the user that no date was selected
End If

End Sub

In my example above the control was a text box called txtSelectDate. You will need to change those parts of the code to whatever you have named your control. You could also assign this to the click event for a text box, but I think using the Double Click event is a much better idea. A small command button next to a text field could also be used.

8. Compile the code and save the form.

9. Now open the form in regular view and double-click that text box. The calendar should then appear. Selecting a date on the calendar will cause it to disappear and the resulting date to be filled into the text field. Simply marvelous isn't it?
 
Katılım
21 Ocak 2007
Mesajlar
106
Excel Vers. ve Dili
Office 2007 Professional Enterprise
buda başka bir örnek
gülsüm hanımın örneğinde küçük değişiklikler yaptım..gün isimlerini türkçeye çevirdim ve ay ilerleme butonlarına ek olarak yıl olarak ileri ve geri ilerleme butonlarını ekledim..gizli access modülü kullanılan çalışmalarda calendar formunun özelliklerinden açılan ve kalıcı olarak ayarlanması gerekir..işine yarayacak azrkadaşlarımızın hizmetine sunulur..umarım gülsüm hanımın izni olur..istemezse eki hemen kaldırırım...herkese iyi çalışmalar..
 
Katılım
22 Ocak 2007
Mesajlar
815
Excel Vers. ve Dili
2003
ne demek zaten &#246;rnek benim de&#287;il oda ba&#351;ka bir yabanc&#305; zat&#305; muhtereme ait
 
Katılım
9 Ocak 2006
Mesajlar
83
gülsüm hanımın örneğinde küçük değişiklikler yaptım..gün isimlerini türkçeye çevirdim ve ay ilerleme butonlarına ek olarak yıl olarak ileri ve geri ilerleme butonlarını ekledim..gizli access modülü kullanılan çalışmalarda calendar formunun özelliklerinden açılan ve kalıcı olarak ayarlanması gerekir..işine yarayacak azrkadaşlarımızın hizmetine sunulur..umarım gülsüm hanımın izni olur..istemezse eki hemen kaldırırım...herkese iyi çalışmalar..
calendrier formundaki vba kodlarında Const mFIRST_DAY = 1 bulunan satırın değerini 2 yaparsanız, takvimin günü pazartesinden başlıyor

Const mFIRST_DAY = 2 yapın
 
Üst