View Full Version : Challenging CmmndButton


Neo90815
08-14-2000, 01:25 PM
Hi,

I have four command buttons on my Call Manager Form, each of them reside next to four lables with two fields each. Once user click on any of the four buttons it will pull up another form called Calendar, which has an Active-X Calendar and two fields called [Date] and [Time].

From my Call Manager Form the four lables are: Date, Acknowledge, Completed, and Promised; EACH lables has two fields [Date] and [Time]. These fields accept value from the Calendar form if user click Insert. The follow code shows the Event Procedure for the Insert Button from the Calendar Form.

****************************************
Private Sub Command17_Click()
[Form_Call Manager].Date = Form_Calendar.Date2.Value
[Form_Call Manager].DateTime = Form_Calendar.Time.Value
End Sub
*************************************

Questions; the above code works great with the first Labled "Date". But I can't figure out how to make it works for the rest of the lables and its fileds; Acknowledge, Promised, etc...

Please help. Thanks!

Richie
08-14-2000, 02:25 PM
I think the easiest way would be to have four separate command buttons on the cal form set the events of them to correspond with the text boxes on your form and just have one button to open the calendar on Call Manager.

Neo90815
08-14-2000, 02:35 PM
Good Idea Richie!

Speaking of separate, maybe I should have four different Calendar Forms for each button?

I can do that and it would work with the same VB code just different field names. Unless anybody else has any other suggestions.

Thanks Richie,

Richie
08-14-2000, 11:48 PM
I do know that it is possible to use one calendar form to set values for several different forms using ifisloaded so this may work,
If Me!Command17.Enabled=True Then
[Form_Call Manager].Date = Form_Calendar.Date2.Value
[Form_Call Manager].DateTime = Form_Calendar.Time.Value
ElseIf Me!Command18.Enabled=True Then
Next action
ElseIf etc.
EndIf
It should work but I haven't tried it yet Goodluck.

Neo90815
08-15-2000, 08:11 AM
Thanks Richie,

I created four separate calendars for each button. It it works perfectly. Thanks for the idea and suggestions.

Sincerely,

Neo