Hi! Newbie here!
I think this question has been posted several times and I have looked into different boards and threads but can't get my form to work properly.
Basically, I have a user form with two textbox and a command button for each. The command button will call the calendar form, where a MonthView calendar is. The user can pick the date on that calendar and the date "should" be placed on the textbox beside the command button that call the form.
But, I can't get the MonthView calendar to pass the date on the correct textbox. Either both are changing or only 1 is changing. I tried using a pass ByVal argument to identify which button called the calendar, but I'm getting more errors on this.
Textbox are called txtInvDate and txtInvDue. Correspondingly, their command buttons are called cmdInvDate and cmdInvDue.
Here's the code for the buttons. The effect here is that on the txtInvDue would change its date based on the date picked by the user.
Here's the command for the calendar to populate the textbox.
What I'm trying to do is pass the value of D (from the command button) to A of the calender, so the calender would know which button called it.
I tried putting the code as
This is giving me more errors instead.
Any idea on how I should code the passing of the value? or other method better than what I'm doing?
I think this question has been posted several times and I have looked into different boards and threads but can't get my form to work properly.
Basically, I have a user form with two textbox and a command button for each. The command button will call the calendar form, where a MonthView calendar is. The user can pick the date on that calendar and the date "should" be placed on the textbox beside the command button that call the form.
But, I can't get the MonthView calendar to pass the date on the correct textbox. Either both are changing or only 1 is changing. I tried using a pass ByVal argument to identify which button called the calendar, but I'm getting more errors on this.
Textbox are called txtInvDate and txtInvDue. Correspondingly, their command buttons are called cmdInvDate and cmdInvDue.
Here's the code for the buttons. The effect here is that on the txtInvDue would change its date based on the date picked by the user.
PHP:
Private Sub cmdInvDue_Click()
Dim D As Integer
D = 1
Calender D:=A
Calender.Show
End Sub
PHP:
Private Sub cmdInvDue_Click()
Dim D As Integer
D = 2
Calender D:=A
Calender.Show
End Sub
Here's the command for the calendar to populate the textbox.
PHP:
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
If A = 1 Then
POReceipt.txtInvDate.Value = MonthView1.Value
' A = 0
Else
POReceipt.txtInvDue.Value = MonthView1.Value
' A = 0
End If
Unload Me
End Sub
What I'm trying to do is pass the value of D (from the command button) to A of the calender, so the calender would know which button called it.
I tried putting the code as
PHP:
Private Sub MonthView1_DateClick(ByVal DateClicked As Date, ByVal A As Integer)
This is giving me more errors instead.
Any idea on how I should code the passing of the value? or other method better than what I'm doing?