[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Get rid of Time in textbox bound to access

Posted on 2006-04-20
4
Medium Priority
?
196 Views
Last Modified: 2010-04-23
Hey everyone,

I have a form with a few textboxes that have databindings to an access database. My problem is that the date fields are filling in with the time as well as the date .I want to get rid of the time ...where always comes up 12:00:00 AM . I just want a Date in the format MM/dd/yyyy , i changed the format of the field in access to be short date but i still get the time.

0
Comment
Question by:csakg6s0
  • 2
4 Comments
 
LVL 12

Expert Comment

by:gbzhhu
ID: 16501746
I think you need to use DataBindings properti'es Format method.  I don't have DB engine to test here at home but can do tomorrow at work

Out of my head just guess try

        Me.TextBox1.DataBindings.Item(0).FormatString = "mm/dd/yyyy"

in form load must be after you set the databindings for the textbox.  If it dopesn't work and nobody else comes with a solution post a comment tomorrow and I will have a go

Cheers
0
 
LVL 12

Accepted Solution

by:
gbzhhu earned 2000 total points
ID: 16501775
I could change the textbox text from a button click using

            Me.TextBox1.Text = Format(Me.TextBox1.Text, "mm/dd/yyyy")

But that cannot be done in the textbox's TextChange event.  events will be recursively raised
0
 
LVL 2

Expert Comment

by:manojkumarps
ID: 16504998
Hello csakg6s0,
         As you are displaying the text in the textbox. You are getting it from the Db whatever it is and then assigning it to the textbox. before assigning the value to the textbox. COnvert the date explicitely to shortdatestring.

Regards,
Manoj
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month18 days, left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question