473,669 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Edit button ?HELP PLEASE

15 New Member
i have an edit button that is supposed enable the txt boxes to be able to write in it does this but when i click save i want the edited person to save


Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdEdit_Click(Index As Integer)
  2.  
  3. txtFullname.Enabled = True
  4. txtAddress.Enabled = True
  5. txtArea.Enabled = True
  6. txtPostcode.Enabled = True
  7. txtContactno.Enabled = True
  8. txtPos.Enabled = True
  9. txtSalary.Enabled = True
  10.  
  11. End Sub
  12.  
  13. Private Sub cmdExit_Click(Index As Integer)
  14.  
  15. counter = EmployeeCollection.Count
  16.  
  17. Dim forcounter As Integer
  18.  
  19. Open "c:\temp\Storage.txt" For Output As #1
  20.  
  21. For forcounter = 1 To EmployeeCollection.Count
  22.  
  23. Print #1, """" & EmployeeCollection.Item(forcounter).Fullname & """,";
  24. Print #1, EmployeeCollection.Item(forcounter).Address & ",";
  25. Print #1, EmployeeCollection.Item(forcounter).Area & ",";
  26. Print #1, EmployeeCollection.Item(forcounter).Postcode & ",";
  27. Print #1, EmployeeCollection.Item(forcounter).Contactno & ",";
  28. Print #1, EmployeeCollection.Item(forcounter).Pos & ",";
  29. Print #1, EmployeeCollection.Item(forcounter).Salary
  30.  
  31. Next
  32. Close #1
  33. End
  34.  
  35. End Sub
  36.  
  37.  
  38. Private Sub cmdFirst_Click(Index As Integer)
  39.  txtEmployeeno.Text = 1
  40.  
  41.    txtFullname.Text = EmployeeCollection.Item(1).Fullname
  42.     txtAddress.Text = EmployeeCollection.Item(1).Address
  43.     txtArea.Text = EmployeeCollection.Item(1).Area
  44.     txtPostcode.Text = EmployeeCollection.Item(1).Postcode
  45.     txtContactno.Text = EmployeeCollection.Item(1).Contactno
  46.     txtPos.Text = EmployeeCollection.Item(1).Pos
  47.     txtSalary.Text = EmployeeCollection.Item(1).Salary
  48.  
  49.    cmdP.Enabled = False
  50.    cmdNext.Enabled = True
  51.  
  52.  
  53.    If counter - 1 < 1 Then
  54.    MsgBox ("First Record")
  55.  
  56.     End If
  57.  
  58.  
  59. End Sub
  60.  
  61.  Private Sub cmdsave_Click(Index As Integer)
  62.  
  63. Set Employee = New clsEmployee
  64.  
  65.     Employee.Fullname = txtFullname.Text
  66.     Employee.Address = txtAddress.Text
  67.     Employee.Area = txtArea.Text
  68.     Employee.Postcode = txtPostcode.Text
  69.     Employee.Contactno = txtContactno.Text
  70.     Employee.Pos = txtPos.Text
  71.     Employee.Salary = txtSalary.Text
  72.  
  73.         txtFullname.Enabled = False
  74.         txtAddress.Enabled = False
  75.         txtArea.Enabled = False
  76.         txtPostcode.Enabled = False
  77.         txtContactno.Enabled = False
  78.         txtPos.Enabled = False
  79.         txtSalary.Enabled = False
  80.  
  81. EmployeeCollection.Add Employee
  82. txtEmployeeno.Text = EmployeeCollection.Count
  83. Set Employee = Nothing
  84.  
  85. End Sub
  86.  

Really greatfull for n e help
yamasassy
Mar 12 '08 #1
3 1229
gobblegob
133 New Member
i have an edit button that is supposed enable the txt boxes to be able to write in it does this but when i click save i want the edited person to save


[code]


Private Sub cmdEdit_Click(I ndex As Integer)

txtFullname.Ena bled = True
txtAddress.Enab led = True
txtArea.Enabled = True
txtPostcode.Ena bled = True
txtContactno.En abled = True
txtPos.Enabled = True
txtSalary.Enabl ed = True


End Sub


Really greatfull for n e help
yamasassy

So these are not being enabled?

change this..
Private Sub cmdEdit_Click(I ndex As Integer)

to this..
Private Sub cmdEdit_Click()

GobbleGob.
Mar 12 '08 #2
Yamasassy
15 New Member
sorry didnt make my self clear , when edited the detaikls save again not over write the persons details in the file
Mar 12 '08 #3
gobblegob
133 New Member
Thats becuase your code only enables the objects for use, it doesnt tell your program do anything else.

try this,

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdEdit_Click(Index As Integer)
  2.    Set Employee = New clsEmployee
  3.  
  4.     txtFullname.Enabled = True
  5.     txtAddress.Enabled = True
  6.     txtArea.Enabled = True
  7.     txtPostcode.Enabled = True
  8.     txtContactno.Enabled = True
  9.     txtPos.Enabled = True
  10.     txtSalary.Enabled = True
  11.  
  12.     Employee.Fullname = txtFullname.Text
  13.         Employee.Address = txtAddress.Text
  14.         Employee.Area = txtArea.Text
  15.         Employee.Postcode = txtPostcode.Text
  16.         Employee.Contactno = txtContactno.Text
  17.         Employee.Pos = txtPos.Text
  18.         Employee.Salary = txtSalary.Text
  19.  
  20.     EmployeeCollection.Add Employee
  21.     txtEmployeeno.Text = EmployeeCollection.Count
  22.     Set Employee = Nothing
  23.  
  24. End Sub
GobbleGob.
Mar 13 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
2328
by: Gilles T. | last post by:
How I can get element ID in the edit mode of datagrid control? If I not in the edit mode, there are no problem. <asp:TemplateColumn ItemStyle-CssClass="grid_column_width_3" ItemStyle-HorizontalAlign="center" ItemStyle-VerticalAlign="top"> <ItemTemplate><%# CType(Container.DataItem("DateStatut"),DateTime).ToString("yyyy-MM-dd") %></ItemTemplate> <EditItemTemplate> <asp:TextBox width="80" CssClass="edit_item" id="txtDateStatut"
4
8376
by: Kevin Myers | last post by:
Hello, Please forgive my reposting of this note with hopefully a more relevant subject line. On an Access 2000 form under Windows 2000 I would like to use a Kodak Image Edit Control to display the contents of a TIFF image file. According to the very limited documentation that I have been able to locate so far, all I should need to do is to drop the Image Edit Control onto the form in design mode, set the control's Image property to...
4
4407
by: DC | last post by:
Newbie's question about .NET datagrid If I use: <asp:EditCommandColumn></asp:EditCommandColumn> When I edit a row, it will automatically show Update and Cancel Link. But when I use: <asp:Button id="btnEdit" runat="server" Text="Edit" CommandName="Edit" CssClass="clickable"Width="50px" /> When I edit a row, the Update/Cancel links don't show up.
1
2903
by: Ann | last post by:
Hi, I have a datagrid contained textbox in the template column. I want to create a button on each row, when a user hits the button the textbox on column of the datagrid is enabled (no postback), an Update button is enabled, user will update the data, when the user hits the update button, then post back. Could anyone please tell me how do I achieve this? Thanks
4
1974
by: Sourav Dutta Gupta | last post by:
I want to change the "scr" like src='images/Edit.ICO' to src='images/XYZ.ICO' dynamically based on some condition. My EditCommandColumn: <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="<img alt='Save' src='images/Save.ICO' height=20 width=20 border=0>" CancelText="<img alt='Cancel' src='images/Cancel.ICO' height=20 width=20 border=0>" EditText="<img alt='Save' src='images/Edit.ICO' height=20 width=20 border=0>"...
2
5584
by: WebBuilder451 | last post by:
I'm working through an example of a formview cortrol. I have bound the control to edit, update, insert, delete stored procs. I have a grid view with a button on it that sets the formview to a recod. It displays fine, except that there is no EDIT button? What could i have done wrong? Also how can you set the current mode to edit? I tried setting the default mode to edit, even but i still get view only. What's going on here? -- thanks (as...
8
1977
by: =?Utf-8?B?bWlrZWc=?= | last post by:
Hi, I am building a small Help Desk application for my company and need to be able to edit "open" help desk issues. I use a simple datagrid to display each issue (6 per page) , with an Edit button. There are a lot of fields across, and my Network Admins would like a way of editing/updating each issue seperately in a a vertical form. I need a way of clicking on the edit button ,bringing up a form with the record, editng the fields, and...
2
2456
by: sowmram | last post by:
Hi, I'm trying to create a site very similar to wiki, where you can edit, save.. Generally update data for the future use... This particular program I wanna do it using javascripts... Please help me out in getting into the solution for the same... Sample prg which I hve done is as below... Looking forward for all of your help...Thanks in advance
1
2019
by: gurmet | last post by:
Hi All I have been looking around for help, and finally post this problem. I created a form to edit a record. Before i can click save button on the edit form i need to check if the data that have been edit exists in the table. But if i m calling the same record and updating the same record without changing anything it should allowed to save. Example: I m creating a table to save all types of courses (course_id, course_code,...
2
3322
by: crapycoder | last post by:
hi all, please help....!! i have added a kodak image edit control on my form. when i click get image button, "abc.img" will be displayed. i have a button named "copy to clipboard". when i click it, i want the image in kodak image edit control to be copied to clipboard.
0
8383
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8587
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7407
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6210
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2792
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 we have to send another system
2
2029
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.