Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 20th, 2013, 09:01 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default HELP-Grid Control Help Need to verify date format and update database record

Hello All,

I have a VB6 Form that has a Grid control. The Grid has 10 columns. The number of rows that get built are dynamically built based upon the number records I pull back from a database call that pulls records back from my query call to the database.

From below you will see that I do not have a lock on my Start Date column. I need to be able to allow a user to manually change the Start Date column verify that it's a valid date time. Right now the initial value for date time cell after my database call is a string in the form of MM/DD/YYYY HH:MM:SS. I would appreciate any help. I was thinking the simplest way to handle this is to have some type of event fire off when a person changes the mouse clicks on/off any cell in the targeted column that needs to get checked as a valid date time.

Second thing I need to do have a way capture the user changed date and update the appropriate record back in the database. Please help as I have been charged to handle this requirement. I haven't touched VB6 in years but I have been charged with making changes to a legacy application. Below is how I'm originally populating my columns and dynamically building my rows in my Grid Control.

Here is a sample of how I'm initially building my Grid .

With shtJobEditDate 'Name of Grid Control

Do Until rsMach.EOF 'rsMach is name of the ADODB.RecordSet

.MaxRows = .MaxRows + 1
.Row = .MaxRows
'.Col = GridCols.KeyCol 'GridCols is an enumeration of column order
'.Text = rsMach!ljtScanKey
.Col = GridCols.CstCtrCol
.Lock = True
.Text = rsMach!ljtCostCenterCd

...
...

.Col = GridCols.StartDTCol
.Text = rsMach!ljtStartTime


I've added a Save Button to my form. And in my btnSave_Click() event I'm trying to use the IsDate function to validate if any entry from any row in my column position 9 is a valid date time format. I've tried the following code but get a runtime error. The Grid control is of a Far Point spSpread control.

IsDate (shtJobEditDate.ActiveCol(9).CellValue(shtJobEditD ate.ActiveSheet))

The compiler states "Invalid qualifier"

Last edited by 2peeps2; July 20th, 2013 at 10:47 AM.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert British format date to American format? fyr PHP How-To 0 December 19th, 2007 02:17 PM
retrieve date with format (M Y) form database php Mahmoud82 PHP How-To 2 November 30th, 2006 06:10 AM
Verify Database giving object reference error cgiuda Crystal Reports 0 May 10th, 2006 07:50 AM
Date format in ASP and in SQL 2000 Database phungleon Classic ASP Databases 1 December 22nd, 2004 11:57 PM



All times are GMT -4. The time now is 11:36 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.