Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Change in DB not showing on form


Reply
 
Thread Tools Display Modes
  #1  
Old 12-15-2006, 07:24 AM
nkechifesie nkechifesie is offline
Regular
 
Join Date: Nov 2006
Posts: 62
Default Change in DB not showing on form


When i edit the data in the database, the form doesnt show the effect unless i scroll back and then forward. Please can you help.
Below is the code am using

Code:
If (MsgBox("Are you sure you want to Edit Vehicle Type: " & RsVehType("txtVEHTYPE"), vbYesNo, "VEHICLE TRACKER") = vbYes) Then response = InputBox("Enter the new Vehicle Type", "VEHICLE TRACKER") response = UCase(response) AdVehType.Execute "UPDATE tblVEHTYPE SET txtVEHTYPE = '" & response & "' WHERE txtVEHTYPE = '" & TxtType.Text & "';" RsVehType.Requery End If

Last edited by reboot; 12-15-2006 at 08:40 AM. Reason: add [vb] [/vb] tags for readability.
Reply With Quote
  #2  
Old 12-15-2006, 07:25 AM
Shurik12 Shurik12 is offline
Steppe Walker

Retired Moderator
* Expert *
 
Join Date: Jul 2002
Location: Ukraine/Russia/Belgium
Posts: 7,227
Default

How are you displaying your data: textboxes, datagrid, msflexgrid,mshflexgrid....?
__________________
"A diaper is not like a computer that makes satisfying burbling noises from time to time, hinting at great inner complexity." Malcolm Gladwell

"I'm sitting here completely surrounded by no beer." Onslow, 'Keeping up appearances'
Reply With Quote
  #3  
Old 12-15-2006, 07:27 AM
morbidangel morbidangel is offline
Regular
 
Join Date: Apr 2005
Posts: 91
Default

What control are you using to present the data on your form? Maybe you should refresh your control after the update in order to show the changes
Reply With Quote
  #4  
Old 12-15-2006, 07:39 AM
nkechifesie nkechifesie is offline
Regular
 
Join Date: Nov 2006
Posts: 62
Default

Am using text box to display and Ado to connect
Reply With Quote
  #5  
Old 12-15-2006, 08:33 AM
PianoMan's Avatar
PianoMan PianoMan is offline
Contributor
 
Join Date: Oct 2003
Location: NC, USA
Posts: 470
Default

Quote:
Originally Posted by nkechifesie View Post
When i edit the data in the database, the form doesnt show the effect unless i scroll back and then forward. Please can you help.
At what point do you display the info in the textbox initially? As has been suggested, if the information you want to display has changed, you'll need to refresh the information in the textbox as well. It won't "automatically" update itself.
__________________
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." ---Rich Cook
Reply With Quote
  #6  
Old 12-15-2006, 08:40 AM
nkechifesie nkechifesie is offline
Regular
 
Join Date: Nov 2006
Posts: 62
Default

Thank you, I have done that now and it works. Would have prefered though if it could show the record that was edited and not go back to the beginning on the record.
Reply With Quote
  #7  
Old 12-15-2006, 09:00 AM
PianoMan's Avatar
PianoMan PianoMan is offline
Contributor
 
Join Date: Oct 2003
Location: NC, USA
Posts: 470
Default

Quote:
Originally Posted by nkechifesie View Post
Thank you, I have done that now and it works. Would have prefered though if it could show the record that was edited and not go back to the beginning on the record.
Maybe I'm not understanding the problem. I'm slow like that sometimes

Why not
Code:
If (MsgBox("Are you sure you want to Edit Vehicle Type: " & RsVehType("txtVEHTYPE"), vbYesNo, "VEHICLE TRACKER") = vbYes) Then response = InputBox("Enter the new Vehicle Type", "VEHICLE TRACKER") response = UCase(response) AdVehType.Execute "UPDATE tblVEHTYPE SET txtVEHTYPE = '" & response & "' WHERE txtVEHTYPE = '" & TxtType.Text & "';" RsVehType.Requery End If txtUpdatedText = txtVEHType 'Or whatever textbox you want updated...

Or are you using a textbox that's bound?
__________________
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." ---Rich Cook
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->