Calendar Updating Various Fields

Raven

Soozie's watchin' you!
Local time
Today, 21:14
Joined
May 1, 2002
Messages
48
I have a main form in which there are 10 date fields which require to be completed.

I decided rather than insert 10 ActiveXCalendars on this original form (which can get very messy, althou it does the job) I would create a new form which holds 1 ActiveXCalendar, together with a close button on this form which updates the field required. The close button code is:

Private Sub CloseCalendar_Click()

Forms!frmPlacingRequest.Date_Received.Value = Me.ActiveXCtlCalendar.Value
Forms!frmPlacingRequest.Headteacher_Notified.Value = Me.ActiveXCtlCalendar.Value

DoCmd.Close acForm, "frmCalendar", acSaveNo

End Sub


The problem I have however, is whatever date is selected from whatever field, it is completed as the same date for all fields!

I need some way of being able to update a specified field from the main form using the same ActiveXCalendar on the other form.

Any ideas would be appreciated.

Thanks
Sue
smile.gif
 
Make sure that when you open up the calendar form, you open it in dialog mode (Open it via a doubleclick on the required field) ie

DoCmd.OpenForm "frmCalTest", , , , , acDialog

Change this code to
Private Sub CloseCalendar_Click()

Forms!frmPlacingRequest.ActiveControl = Me.ActiveXCtlCalendar.Value

DoCmd.Close acForm, "frmCalendar", acSaveNo
End Sub

This places the calendar value in the field you have double clicked from.

Edit - Wheres the speelchecker on this forum??

[This message has been edited by Fizzio (edited 05-22-2002).]
 
Fiz, their isunt wun
smile.gif
 
Hey Fiz!

My code looks much simplier now and it actually does what I want for a change!

Fanks a lot!!

smile.gif
 
Just a thought,

Can't you just have 10 buttons on the Calander form that correspond to your fields so that when you click them it updates that field with the current selected date?

Or am I missing the point completely?
 

Users who are viewing this thread

Back
Top Bottom