Solved

showing only date, not time, in Data Form Wizard field from access table

Posted on 2004-08-22
1
142 Views
Last Modified: 2010-04-23
I've used the Data Form Wizard to display/enter dates the user has entered.  It's connected to an access table and it keeps displaying the time even though it's a Short Date in the access table.  I've seen other answers but they all have to do with SQL.  I have very limited experience in sql if it requires coding. Please help.
0
Comment
Question by:chrisamuel
1 Comment
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 50 total points
ID: 11870066
If you don't want to do it in sql use the onformat event of the databinding

something like this

   Private Sub DataForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim oBind As Binding = New Binding("Text", Me.yourdataset, "Table1.yourdate")
        AddHandler oBind.Format, AddressOf formatdate2
        Me.yourtextbox.DataBindings.Add(oBind)

    End Sub


    Private Sub formatdate2(ByVal sender As Object, ByVal cevent As ConvertEventArgs)
        cevent.Value = CType(cevent.Value, Date).ToString("d")
    End Sub
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now