473,326 Members | 2,680 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Call calendar from code.

489 256MB
I have an option in my code that has user select Yes to select the current date, No to select from a calendar, I'm having problems with the code when the user selects No I don't know if there is a way to display the calendar from code. I don't have any problem when using a form. Is there a way to display the calendar by code?
Thanks for any help.
May 21 '16 #1
4 2200
zmbd
5,501 Expert Mod 4TB
CD Tom,
What calendar are you using...
Without that information and the code you are using there is no way to answer your question.

If you are using the newer versions of Access, the calendar control has been depreciated.
Replacing the Calendar Control in Access 2010 Applications Office 2010

In ACC2013 and newer the control, including the activex mentioned in the above link, has been completely removed (IIUC) because of the embedded date-picker in the text-box control.

If you are using the newer versions, any bound text control that is bound to a data-type "date" will have the pick-date icon popup when they enter/select the control and there is the [Show Date Picker] property that can be toggled to either show for dates or not at all.
May 22 '16 #2
CD Tom
489 256MB
Sorry about that I'm using Access 2007. I've used the calendar in regular forms where I create a text box set the format "Show date picker" to "for Dates" What I'm trying to do now is I have a command button that ask user if they want to use the current date, (match date),
Expand|Select|Wrap|Line Numbers
  1.     If vmark = vbYes Then
  2.         vmsg = "Use match date or select a date? Yes to use match date. No to select a date, Cancel to exit"
  3.         vmsgans = MsgBox(vmsg, vbYesNoCancel) 
  4.         If vmsgans = vbCancel Then
  5.             Exit Sub
  6.         End If
  7.         If vmsgans = vbYes Then
  8.             StrSql = "Update masterb set Family_Plan = true, Releasesigned = #" & VShootDate & "# where current_match = true"
  9.             DoCmd.RunSQL (StrSql)
  10.         End If
  11.         If vmsgans = vbNo Then
  12.  
  13.  
  14.  
  15.         End If
  16.     End If
  17.  
I would like to display a calendar for the user to be able to select a date. I've thought about having a text box set as for the date and invisible, and if the user select No, then make the text box visible and then after the user selects the date update the file with the proper information.
When I tried this the program doesn't stop when I give the focus to the now visible date text box and the update statement doesn't have the date.
So what do you think, I'm probably still not clear so if you need more information let me know.
Thanks for you help.
May 22 '16 #3
jforbes
1,107 Expert 1GB
I don't exactly like this solution, but it's the best I could come up with.

If you have a TextBox with the Format set to a Date Format, like ShortDate and have it's ShowDatePicker set to ForDates, you can set Focus on the TextBox and then SendKeys for {Alt}+{DownArrow} and the DatePicker will show to the User:
Expand|Select|Wrap|Line Numbers
  1. Me.Text0.SetFocus
  2. SendKeys "%{DOWN}"
  3.  
May 24 '16 #4
zmbd
5,501 Expert Mod 4TB
J, I agree, and it appears to be the only long term solution without either using a third party add-in or building your own calendar form and passing data back and forth... yuck.

The thing is, the user only has to click on the date picker when entering the text box... so is this really a needed tool?
May 25 '16 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Leythos | last post by:
I would like to find a community calendar source for our 4H group to use. I would like to to show the days of the month in a typical calendar method and then have access for an administrative user...
4
by: paritosh mahana | last post by:
Hi all, How can I call python code from my C# code. One thing is to make an ..exe file of the python program and then try to call it from my C# code. But I don't like that idea. Is there any...
0
by: michael | last post by:
How do I call from c#, PHP code that will print/echo to the screen (web browser)? For example index.aspx ------------ <% // code to call my_php_file.php .....
0
by: pedery | last post by:
Thanks! This might just be what I'm looking for. - Peder - >-----Original Message----- >Hi > >Check the following site
12
by: Ricky | last post by:
Hi I know that we can call C++ code from C# using COM interop, how about do the reverse? Ricky
2
by: Bruce W..1 | last post by:
I want to change the display style of certain days in my Calendar control. This is done with the DayRender event. So I put this in the codebehind: private void Calendar1_DayRender (object...
2
by: Kajsa Anka | last post by:
Before I re-invent something I would like to ask if there exists some code that can be used for create the HTML code for a calendar which I then can include on a web page. The module in the...
2
Inbaraj
by: Inbaraj | last post by:
Sir, I want to call javascript code in Asp.net(C#) page. I have done this before but i forget the keyword to run the javascript in asp.net page.... Help me in this matter.... Thanks...
10
by: =?Utf-8?B?UmF2aSBTaGFua2Fy?= | last post by:
Hi, I have a requirement where I need to call methods written in VB.Net from a C++ code. I have been going crazy reading various articles on the net w.r.t interop and marshalling but an more...
8
by: Luna Moon | last post by:
Hi all, As a C/C++ programmer, there are a few reasons to use Fortran: (1) Fortran is very similar to Matlab and easy to port; (2) Fortran has support of complex numbers and vectorized numbers...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.