|
-
Jul 8th, 2008, 11:28 AM
#1
Thread Starter
Junior Member
auto saving to access database
I have a datagrid that is bound via a datasource to an access database , i want the gird to autosave to the row changed in the gird to the database without clicking the save button in the toolbar that appears when you drag a datagrid onto a form , can anyone tell me how this is achievable , or even better a small simple downloadable project that I can have a look at
thanks
-
Jul 8th, 2008, 12:30 PM
#2
Re: auto saving to access database
You could use a timer control set at some interval like 5 minutes. Then in its timer event procedure you could call the .PerformClick event of the save button.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 8th, 2008, 12:59 PM
#3
Thread Starter
Junior Member
Re: auto saving to access database
hmmm thanks , I mean when you leave the row that you are editing then the row you have been editing gets saved without having to press the save button
do you know how this is achievable
-
Jul 8th, 2008, 01:21 PM
#4
Fanatic Member
Re: auto saving to access database
Use the rowLeave event to save the row.
vb Code:
Private Sub DataGridView1_RowLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.RowLeave
End Sub
CLanguage; 
IF Post = HelpFull Then
RateMe
Else
Say("Shut UP")
End If
DotNet rocks
VB 6, VB.Net 2003, 2005, 2008, 2010, SQL 2005, WM 5.0,ahem ?OpenRoad?
-
Jul 8th, 2008, 01:22 PM
#5
Re: auto saving to access database
You could use the IsRow Dirty on RowLeave to Call the update
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jul 8th, 2008, 02:33 PM
#6
Thread Starter
Junior Member
Re: auto saving to access database
hi thanks for the replies this is what I am looking for
but could you help me a bit more with the code
so using
Private Sub DataGridView1_RowLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.RowLeave
'then see if row is dirty - this is the bit I am stuck on
if isrow dirty then
'call save button click event
end if
End Sub
the bit I am having a problem with is finding out if the row is dirty or not as isrow dirty is not compiling , what is the syntax for finding out if the row is dirty in this sub routine ?
thanks
-
Jul 8th, 2008, 02:41 PM
#7
Fanatic Member
Re: auto saving to access database
This should do it for you 
Code:
If DataGridView1.IsCurrentRowDirty Then
CLanguage; 
IF Post = HelpFull Then
RateMe
Else
Say("Shut UP")
End If
DotNet rocks
VB 6, VB.Net 2003, 2005, 2008, 2010, SQL 2005, WM 5.0,ahem ?OpenRoad?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|