 |
 |

12-15-2006, 07:24 AM
|
|
Regular
|
|
Join Date: Nov 2006
Posts: 62
|
|
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.
|

12-15-2006, 07:25 AM
|
|
Steppe Walker
Retired Moderator * Expert *
|
|
Join Date: Jul 2002
Location: Ukraine/Russia/Belgium
Posts: 7,227
|
|
|
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'
|

12-15-2006, 07:27 AM
|
|
Regular
|
|
Join Date: Apr 2005
Posts: 91
|
|
|
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
|
|

12-15-2006, 07:39 AM
|
|
Regular
|
|
Join Date: Nov 2006
Posts: 62
|
|
|
Am using text box to display and Ado to connect
|
|

12-15-2006, 08:33 AM
|
 |
Contributor
|
|
Join Date: Oct 2003
Location: NC, USA
Posts: 470
|
|
Quote:
Originally Posted by nkechifesie
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
|

12-15-2006, 08:40 AM
|
|
Regular
|
|
Join Date: Nov 2006
Posts: 62
|
|
|
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.
|
|

12-15-2006, 09:00 AM
|
 |
Contributor
|
|
Join Date: Oct 2003
Location: NC, USA
Posts: 470
|
|
Quote:
Originally Posted by nkechifesie
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
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|