473,474 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Date button to add date to grid

Does anyone know how I can create a button that will enter the date Now into
a datetime field on a data grid?

Thanks in advance
Nov 21 '05 #1
1 957
Hi Jim,

You can add the following code in the Button_Click event handler:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Specify the row and column number for the cell whose value you wish to change

Me.DataGrid1(1, 1) = Now

End Sub

To change the value of the current cell, you can use:

Me.DataGrid1(Me.DataGrid1.CurrentCell) = Now

Hope this helps.

Thanks

Mona[Grapecity]

"Jim Campau" <ji********@bausch.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Does anyone know how I can create a button that will enter the date Now into
a datetime field on a data grid?

Thanks in advance

Nov 21 '05 #2

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

Similar topics

4
by: Peter Bailey | last post by:
I have a vba string taht dynamically creates the query which has two dates in it that it grabs off an open form as a string from the textbox. What I generate in vba is: SELECT DOSMBK.Date,...
1
by: kevcar40 | last post by:
Hi i have a table that contains a number of fields task : text create date : short date revision date :short date every 90 days i need to review the record(make sure conditions still apply)...
0
by: Oz | last post by:
Hi Using VS.NET 2003, Windows XP SP1, We have a page which has been developed using ASP.NET. On it, is a button which when clicked is supposed to add some data to a table. When the button is...
3
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine,...
1
by: pht204 | last post by:
Hi there, I have a list of date on my table: ClientName ClientPurchase PurchaseDate PuarchesItems Let's say, the purchas dates are multiples and I want to get each clients with their most...
2
by: Adam Sandler | last post by:
Hello, In VWD 2005 here. Working with a gridview that has the edit button enabled. One of the columns in the grid is of date type in the database. When then user edits the date, clicks the...
5
by: crystalattice | last post by:
I'm creating a shelve interface using Tkinter. I have a button that allows the user to modify an existing entry; when the button is clicked, a new TopLevel window appears with Entry boxes holding...
7
helpwithcode
by: helpwithcode | last post by:
Hi people, I am just learning java.I have been creating a project which involves JDBC Connectivity.I find that the statements, String string_dob=text_dob.getText(); //Converting string to...
2
by: Andrus | last post by:
I need to display and edit only date part in DataGridView column whose data source type is DateTime?. The following code shows and allows to edit also time part. How to modify this code so that...
0
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
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
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
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
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
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.