473,508 Members | 4,324 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying Date only in a combobox

I am loading up a combobox with data from an access database. The field I am loading is a date/time datatype. The data in the field is a short date(ex. 01/22/2004). When I load the combobox with the data it appears correct. When I click on the dropdown arrow of the combobox, all of the entries have 12:00:00 AM added to the end of the date entries. Instead of displaying 01/22/2004 the combobox displays 01/22/2004 12:00:00 AM. What do I need to do to get rid of the 12:00:00 AM?

Thank you
Nov 20 '05 #1
4 1364
MyDate = Format(TheDate, "m/d/yyyy")

Bryan Martin
sp**@ahwayside.com
"John Suru" <jd*@rrbiznet.com> wrote in message
news:8F**********************************@microsof t.com...
I am loading up a combobox with data from an access database. The field I am loading is a date/time datatype. The data in the field is a short
date(ex. 01/22/2004). When I load the combobox with the data it appears
correct. When I click on the dropdown arrow of the combobox, all of the
entries have 12:00:00 AM added to the end of the date entries. Instead of
displaying 01/22/2004 the combobox displays 01/22/2004 12:00:00 AM. What do
I need to do to get rid of the 12:00:00 AM?
Thank you

Nov 20 '05 #2
* =?Utf-8?B?Sm9obiBTdXJ1?= <jd*@rrbiznet.com> scripsit:
I am loading up a combobox with data from an access database. The
field I am loading is a date/time datatype. The data in the field is a
short date(ex. 01/22/2004). When I load the combobox with the data it
appears correct. When I click on the dropdown arrow of the combobox, all
of the entries have 12:00:00 AM added to the end of the date
entries. Instead of displaying 01/22/2004 the combobox displays
01/22/2004 12:00:00 AM. What do I need to do to get rid of the 12:00:00
AM?


Do you use a databound combobox?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
I am not using a databound combobox. I am using a subroutine that accepts 3 parameters. They are the combobox(cbo), the query string(str) and the Field. The sub is below
private sub Fillcbo(cbo as combobox, str as string, Field as string
dim dt as datatabl
dim dtr as dataro
cbo.items.clear(
objConnection.Open(
objDataAdapter1= New OleDbDataAdapter(str, objConnection
objDataAdapter.Fill(dt
For Each dtr in dt.Row
cbo.Items.Add(dtr(Field)
Nex
objConnection.Close(
objDataAdapter.Dispose()
Nov 20 '05 #4
* =?Utf-8?B?Sm9obiBTdXJ1?= <jd*@rrbiznet.com> scripsit:
I am not using a databound combobox. I am using a subroutine that accepts 3 parameters. They are the combobox(cbo), the query string(str) and the Field. The sub is below:
private sub Fillcbo(cbo as combobox, str as string, Field as string)
dim dt as datatable
dim dtr as datarow
cbo.items.clear()
objConnection.Open()
objDataAdapter1= New OleDbDataAdapter(str, objConnection)
objDataAdapter.Fill(dt)
For Each dtr in dt.Rows
cbo.Items.Add(dtr(Field))
Next
objConnection.Close()
objDataAdapter.Dispose()


Then, have a look at the 'DateTime''s 'ToString' method, or, as the
other reply suggests, 'Strings.Format'.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
508
by: Dave Posh | last post by:
I seem to be having a problem displaying time stored in mysql. The format stored in the database is 13:15:05. The database data type is time. I'm using asp vbscript and sql to retrieve the time...
2
2500
by: Susan Bricker | last post by:
Greetings! Still the same application (as previous posts). I worked on the app while at work (don't tell my boss ... cause this is just for fun and not work related) and the form was working,...
7
3246
by: Susan Bricker | last post by:
Sorry..I keep hitting the wrong key and sending the post too soon... The problem: COMBOBOX not displaying all possible rows. The RecordSource (generated by SQL view of the Query Builder) is:...
15
1500
by: Bo Diddly | last post by:
Hi everyone, I am relatively new to VB.Net, and database programming. I have a database with four tables, set up as follows: tblBook BookID... key Book... All the book titles of the Bible...
4
1403
by: KitKat | last post by:
Problem trying to figure this out, using a combo box selection I need to go to each folder, Cam 1, Cam 2, Cam 4, Cam 6, Cam 7,and Cam 8 and display each picture (from selection) from each folder...
3
1689
by: sharperrr | last post by:
Access2000 Hi I have a combobox which displays a list of values dependent on another field. On the fields onchange event the rowsource of the combobox changes according to the value in the...
33
5485
by: buss123 | last post by:
Hi all, combo box script code was working in IE perfectly with all modes but OnChange event was not working in FireFox(editable mode, if we select valuese that combo box values r...
1
1154
by: deepthisoft | last post by:
hi, I want to change the combobox displaying value depending up on the action value. This is the example code, <html> <head> </head> <script Language="JavaScript"> function check(action) {
5
1938
by: sejal17 | last post by:
hello everyone, I have a problem with displaying records between two dates.Below is my designing page: start date: combobox of month(smonth) & combobox of year(syear) end date :...
0
7228
marktang
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,...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
Oralloy
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,...
0
7393
jinu1996
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...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5635
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,...
1
5057
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...
0
4715
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...
0
426
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...

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.