473,765 Members | 2,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing dates from combo boxes populated by Calendar Control 10.0

3 New Member
Hi All,

I'm in the process of creating a database that allows users to enter details into a form which includes a date range as start and end dates.

I have used the inbuilt Calendar Control 10.0 control to allow users to select the date. It is linked to two combo boxes [cmbStartDate] and [cmbEndDate] using the following code (this code is repeated for each combo box):

Expand|Select|Wrap|Line Numbers
  1.  Private Sub cmbStartDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  2.  
  3. Set cmbOriginator = cmbStartDate
  4.  
  5. ocxCalendar.Visible = True
  6. ocxCalendar.SetFocus
  7.  
  8.     If Not IsNull(cmbStartDate) Then
  9.  
  10.        ocxCalendar.Value = cmbStartDate.Value
  11.  
  12.     Else
  13.  
  14.        ocxCalendar.Value = Date
  15.  
  16.     End If
  17.  
  18. End Sub 
And..

[code] Private Sub ocxCalendar_Cli ck()
''Update the ComboBox with the value entered into the ComboBox
''Put the value back into the relevant ComboBox
cmbOriginator.V alue = ocxCalendar.Val ue

''Hide the calendar
cmbOriginator.S etFocus
ocxCalendar.Vis ible = False

''Clear the variable
Set cmbOriginator = Nothing

End Sub [\CODE]

This all seems to work fine- however, when I try to write the selected dates to a table or use them in a query they are not recognised (the form obviously needs to be open whilst the query runs), but if I manually type dates into these combo boxes these dates are picked up fine.

This is beginning to drive me mad so any help would be greatly appreciated.

Mark
Aug 23 '07 #1
2 2675
MobiusDick
3 New Member
Hello All,

I've just re-read my post and I've missed out a vital piece of information: When the user has selected the relevant dates from the calendar control I am attempting to write the information to a table using an append query with [FORMS]![frmUpdate]![FieldName] syntax.

This works for all manually typed information from other fields on the form-but not for the VB-inserted dates from the control.

Does anyone know why?

Thank you
Aug 24 '07 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
You need to pass the date values either to bound textboxes or to Public variables which will hold the values so they are available later.
Sep 1 '07 #3

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

Similar topics

3
8234
by: Matthew | last post by:
I currently have a form in MS Access that has certain combo boxes which specify criteria in order to run a query based on that criteria. I want to add to this, a calendar from which a user will be able to click on a date, where the chosen date will then be used as the criteria for the control source of the calendar. What do I need to do to make the calendar active?? I can physically get it on my form, and specify the criteria in my...
14
5346
by: Gary Shell | last post by:
I have five comboboxes each has a item listed populated by hand in the IDE. Each has the text property bound to a text field in the database. When I initially fill the dataset and display the page all of these combo boxes display the correct data, but all of them are highlighted as if they have focus. If I click in on and then click another control the highlight goes away. I have a tabbed interface and If I navigate to another tab and...
2
1650
by: saloom | last post by:
Hi i created a calendar using the active xcontrols from the tools menu.I want the back color of the box containing the date to change based on the value of a field in the table at that specific date. I realise now that you cannot change the format of individual dates in the calendar, so i added text boxes above each date and i clicked on "bring to front". the code i wrote works because in design view i can see that the back color of the...
2
3069
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and displays data dependent on what has been typed in. After having trouble with populating my second combo box (I eventually populated it by putting the fields for both combo boxes in 1 separate query) I am now having problems with the 3rd one and am...
7
2419
by: evilcowstare via AccessMonster.com | last post by:
Hi, I have searched the forum for answers on this and to be honest as a novice I find it a bit confusing so apologies if it is simple. There are some searches that I want to apply to my database. 1. To search for all records between 2 dates and display them in a report 2. To be able to show all records which have a selection against them made from a combo box 3. To be able to combine the two, selecting the option from a combo and then...
6
4909
by: GaryGreenberg | last post by:
I am developing a web page for order processing using Spring MVC. In my JSP I have a table populated from the list of orders that are passed in the model (form backing object). Some fields there are filled and some are not. User is suppose to complete mandatory fields and submit the form further. I have it almost done except one thing where I can use some help. One <td> contains 2 related combo boxes for shipping service selection: First...
6
3682
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
1
2908
by: Dave | last post by:
Hello all, First I'd like to apologize...This post was meant to be put in my previous post, but I tried many times without success to reply within my previous post. Now here goes... I have a main form (RD Form) with 4 combo boxes (i.e. cbo1, cbo2, etc) and a subdatasheet (the subform...let's call it subInfo) below the combo boxes on the RD Form. I hope this eliminates any confusion of the
3
2492
by: Mike P | last post by:
I am entering two dates into textboxes and using them as control parameters in an SQL DataSource which is being used to populate a gridview. I am using a custom validator to check if the data entered into the text boxes are valid dates, but even when my code captures that they are not valid dates it seems like it still tries to populate the gridview and in doing so gives me the error 'Conversion failed when converting datetime from...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7378
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.