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 -
Private Sub cmdEdit_Click(Index As Integer)
-
-
txtFullname.Enabled = True
-
txtAddress.Enabled = True
-
txtArea.Enabled = True
-
txtPostcode.Enabled = True
-
txtContactno.Enabled = True
-
txtPos.Enabled = True
-
txtSalary.Enabled = True
-
-
End Sub
-
-
Private Sub cmdExit_Click(Index As Integer)
-
-
counter = EmployeeCollection.Count
-
-
Dim forcounter As Integer
-
-
Open "c:\temp\Storage.txt" For Output As #1
-
-
For forcounter = 1 To EmployeeCollection.Count
-
-
Print #1, """" & EmployeeCollection.Item(forcounter).Fullname & """,";
-
Print #1, EmployeeCollection.Item(forcounter).Address & ",";
-
Print #1, EmployeeCollection.Item(forcounter).Area & ",";
-
Print #1, EmployeeCollection.Item(forcounter).Postcode & ",";
-
Print #1, EmployeeCollection.Item(forcounter).Contactno & ",";
-
Print #1, EmployeeCollection.Item(forcounter).Pos & ",";
-
Print #1, EmployeeCollection.Item(forcounter).Salary
-
-
Next
-
Close #1
-
End
-
-
End Sub
-
-
-
Private Sub cmdFirst_Click(Index As Integer)
-
txtEmployeeno.Text = 1
-
-
txtFullname.Text = EmployeeCollection.Item(1).Fullname
-
txtAddress.Text = EmployeeCollection.Item(1).Address
-
txtArea.Text = EmployeeCollection.Item(1).Area
-
txtPostcode.Text = EmployeeCollection.Item(1).Postcode
-
txtContactno.Text = EmployeeCollection.Item(1).Contactno
-
txtPos.Text = EmployeeCollection.Item(1).Pos
-
txtSalary.Text = EmployeeCollection.Item(1).Salary
-
-
cmdP.Enabled = False
-
cmdNext.Enabled = True
-
-
-
If counter - 1 < 1 Then
-
MsgBox ("First Record")
-
-
End If
-
-
-
End Sub
-
-
Private Sub cmdsave_Click(Index As Integer)
-
-
Set Employee = New clsEmployee
-
-
Employee.Fullname = txtFullname.Text
-
Employee.Address = txtAddress.Text
-
Employee.Area = txtArea.Text
-
Employee.Postcode = txtPostcode.Text
-
Employee.Contactno = txtContactno.Text
-
Employee.Pos = txtPos.Text
-
Employee.Salary = txtSalary.Text
-
-
txtFullname.Enabled = False
-
txtAddress.Enabled = False
-
txtArea.Enabled = False
-
txtPostcode.Enabled = False
-
txtContactno.Enabled = False
-
txtPos.Enabled = False
-
txtSalary.Enabled = False
-
-
EmployeeCollection.Add Employee
-
txtEmployeeno.Text = EmployeeCollection.Count
-
Set Employee = Nothing
-
-
End Sub
-
Really greatfull for n e help
yamasassy
3 1229
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.
sorry didnt make my self clear , when edited the detaikls save again not over write the persons details in the file
Thats becuase your code only enables the objects for use, it doesnt tell your program do anything else.
try this, - Private Sub cmdEdit_Click(Index As Integer)
-
Set Employee = New clsEmployee
-
-
txtFullname.Enabled = True
-
txtAddress.Enabled = True
-
txtArea.Enabled = True
-
txtPostcode.Enabled = True
-
txtContactno.Enabled = True
-
txtPos.Enabled = True
-
txtSalary.Enabled = True
-
-
Employee.Fullname = txtFullname.Text
-
Employee.Address = txtAddress.Text
-
Employee.Area = txtArea.Text
-
Employee.Postcode = txtPostcode.Text
-
Employee.Contactno = txtContactno.Text
-
Employee.Pos = txtPos.Text
-
Employee.Salary = txtSalary.Text
-
-
EmployeeCollection.Add Employee
-
txtEmployeeno.Text = EmployeeCollection.Count
-
Set Employee = Nothing
-
-
End Sub
GobbleGob.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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"
|
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...
|
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.
|
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
|
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>"...
| |
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...
|
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...
|
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
|
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,...
|
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.
|
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,...
| |
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,...
|
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...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |