hello everyone!
I would like to add a calenda option onto the form next to the Date field, so that user can just select the date from the calendar instead of typing the date, can someone help?
thanks!
bluemoon
15 2306 NeoPa 32,556
Expert Mod 16PB
When using the Toolbox toolbar (Form design) there is an option at the end called "More Controls". In there you should find a standard one called "Calendar Control n.n".
thanks! but then I would like to hide the calenda until user click on a little button next to the Date field. I was thinking of add a command button next to the Date field, when user click on the command button, calenda open as a dialog form. Does it work that way? is there any other better way, since I have about 10 date fields, I would have to make 10 pop up dialog forms.
thanks!
bluemoon
Hi,
What I did was I put the calenda next to the Date field and set Visible=No, then I put a command button next to the date field, when user click on the command button, I made the calenda visible=true, but then I don't know how to make the calenda visibile=false when user is done with date selection.
thanks!
bluemoon
NeoPa 32,556
Expert Mod 16PB
How about setting up an AfterUpdate event procedure for the control that is being set by the Calendar control. When that runs it can set the Calendar control back to invisible.
You could even make the showing of it triggered by entering the other control (On Enter) instead of having to add loads of Command Buttons.
Sound like an idea?
NeoPa,
You mean to add the code "me.calenda.visible=false" onto the AfterUpdate of the DateField? I did that but it did't really work.
In the calenda Event Property, it only has 5 events: On Updated, On enter, On Exit, On Got Focus and On Lost Focus, I've tried them all and nothing works. Please help.
thanks!
Bluemoon
NeoPa 32,556
Expert Mod 16PB
NeoPa,
You mean to add the code "me.calenda.visible=false" onto the AfterUpdate of the DateField? I did that but it did't really work.
I do mean that. In what way do you mean it didn't work.
I do mean that. In what way do you mean it didn't work.
well, once I selected the date from the calenda, I hit enter key in the keyboard to select the date, the selected date appear in the DateField box, but then the calendar still visible.
thanks alot for your help.
bluemoon
NeoPa 32,556
Expert Mod 16PB
Can you post all the code you have for the controls involved?
Can you post all the code you have for the controls involved?
Yup, here is the code.
My form has a field call txtDate. I place a small cmdCal next to the txtDate field and the calendar next to the cmdCal button, but calendar is set to Visible=No (in the property). When user click on the cmdCal, Calendar is set to visible=true, then user choose a date, then hit enter, the selected date appears in the txtDate box, then I want the calendar to be invisible.
here is my code - Private Sub cmdCal_Click()
-
Me.Calendar.Visible = True
-
End Sub
-
-
Private Sub txtDate_AfterUpdate()
-
Me.Calendar.Visible = False
-
End Sub
thanks alot!
bluemoon.
if you have any other idea, please advise. basicly, I just need to have a pull-up calendar for the date fields, that's all.
You could try this code, the txtbox is changed to a combobox when it is clicked on the calendar becomes visiable and the date can be selected which goes into the combobox and calendar becomes invisable. I have called the combobox (startdate), you can change that to what ever suits you. -
Private Sub StartDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
-
' Unhide the calendar and give it the focus
-
Calendar4.Visible = True
-
Calendar4.SetFocus
-
' Match calendar date to existing date if present or today's date
-
If Not IsNull(StartDate) Then
-
Calendar4.Value = Date
-
Else
-
Calendar4.Value = StartDate.Value
-
End If
-
-
End Sub
-
-
Private Sub Calendar4_Click()
-
' Copy chosen date from calendar to originating combo box
-
StartDate.Value = Calendar4.Value
-
' Return the focus to the combo box and hide the calendar
-
StartDate.SetFocus
-
Calendar4.Visible = False
-
-
End Sub
-
Hope this helps
NeoPa 32,556
Expert Mod 16PB
Try : - Private Sub cmdCal_Click()
-
Me.Calendar.Visible = True
-
End Sub
-
-
Private Sub Calendar_AfterUpdate()
-
Me.Calendar.Visible = False
-
End Sub
Hopefully that will work. I'm not sure why your code didn't but I can't test it from here.
NeoPa 32,556
Expert Mod 16PB
Also, look at Itchy's code. Although i wouldn't use the events he's used, there is some code in there that could add to the friendliness of your app. Worth nicking I would say ;)
You could try this code, the txtbox is changed to a combobox when it is clicked on the calendar becomes visiable and the date can be selected which goes into the combobox and calendar becomes invisable. I have called the combobox (startdate), you can change that to what ever suits you. -
Private Sub StartDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
-
' Unhide the calendar and give it the focus
-
Calendar4.Visible = True
-
Calendar4.SetFocus
-
' Match calendar date to existing date if present or today's date
-
If Not IsNull(StartDate) Then
-
Calendar4.Value = Date
-
Else
-
Calendar4.Value = StartDate.Value
-
End If
-
-
End Sub
-
-
Private Sub Calendar4_Click()
-
' Copy chosen date from calendar to originating combo box
-
StartDate.Value = Calendar4.Value
-
' Return the focus to the combo box and hide the calendar
-
StartDate.SetFocus
-
Calendar4.Visible = False
-
-
End Sub
-
Hope this helps
Hi,
I used your code and it worked just fine. But there is only one problem left. When I click select TODAY DATE from the calenda, it gave me the date of 12/30/1899 in my Date box. And this happend only the first round. For example, if I select TODAY DATE on the calendar, it gave me the date of 12/30/1899, then I reselect, it gave me the correct date of (10/15/2008). Any idea why? I have no clue why it happended that way.
thanks!
bluemoon
Hi,
I used your code and it worked just fine. But there is only one problem left. When I click select TODAY DATE from the calenda, it gave me the date of 12/30/1899 in my Date box. And this happend only the first round. For example, if I select TODAY DATE on the calendar, it gave me the date of 12/30/1899, then I reselect, it gave me the correct date of (10/15/2008). Any idea why? I have no clue why it happended that way.
thanks!
bluemoon
In the properties for the calendar, check what is set for the value field(third last field under All tag). Set it to a recent date date.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Fendi Baba |
last post by:
The function is called from opencalendar(targetfield). Thanks for any
hints on what could be the problem.
..............................................................
var...
|
by: Stimp |
last post by:
preferably one that when clicked can update three date dropdowns (day,
month, year) like
http://www.visitdublin.com/carhire/avis.asp
Don't mind paying for the file... anyone seen something...
|
by: Lumpierbritches |
last post by:
I have a Calendar control (me.mycal) and a subform sbfAppointments, with
child/parent links from Parent/MyCal (ActiveX) to Child/ApptDate in the subform
sbfAppointments.
I would like to be able...
|
by: jphelan |
last post by:
After opening and clicking on the popup calendar command control
button, "fdlgCal"; I click on a given date. The date is suppose to
then appear in a date field next to the control. Instead, I get...
|
by: caine |
last post by:
I have a clickable calendar, which user can select the day that they
want to view the news linking to. My calendar has the clickable event
day, but once the user click it, the day selected could...
|
by: thorpk |
last post by:
I posted this problem earlier in the month and some one decided it was
better to change the subject and ask a completely different question.
I am therefore reposting. I am hoping some one can...
|
by: EyeHawk |
last post by:
OK, hopefully somebody can help me out again.
My next problem is updating 3 form fields (type list/menu option) that correspond to a date, one for month, one for day and one for year when the user...
|
by: mathewgk80 |
last post by:
HI all,
I am having popup calendar Javascript code. But i dont know how it is connecting to asp.net code.. I am using asp.net,c#.net and also using 3tier architecture with master page....
I...
|
by: swethak |
last post by:
Hi,
I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
|
by: swethak |
last post by:
hi,
i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |