Create a form to modify existing records

Solved/Closed
Lucy - Jun 8, 2010 at 07:54 PM
 Corina - Jun 10, 2010 at 06:24 PM
Hi,

My name is Lucy, I was wondering if any person here could help me.

I am having this trouble, i have a form where I enter the name of client, very simple, two buttons save and exit, but i have been trying to create a form with a dropdown menu or combo to show to the user the actuals clients and if they want to modify the name they can do it. Could any of you guys help me out. Thanks

P.S The sheet where the data is, is the sheet20 and the name of the dropdown menu is Combobox1

Thanks again



4 replies

Please help me out is urgent... Thanks
0
rizvisa1
Posts
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
770
Jun 9, 2010 at 06:14 AM
Could you please upload a sample file with sample data etc on some shared site like https://authentification.site , http://docs.google.com, http://wikisend.com/ , http://www.editgrid.com etc and post back here the link to allow better understanding of how it is now and how you foresee. Based on the sample book, could you re-explain your problem too
0
Hi,

Here is the address https://authentification.site/files/22885672/Clients.xls

There is two problems:

1. I want the userform1 to be shown when the file clients open, the first thing the user woul see and everytime the user press the tab sheet1 the form pop up or open again.

2. I have two buttons, the add client and modify clients, I would want trough the modify clients button to change existing records of the clients in this case just the name of the client

Thanks and Thanks

Lucy
0
rizvisa1
Posts
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
770
Jun 9, 2010 at 06:14 PM
Ok for your first problem

Add this to ThisWorkbook (under excel objects in VBE)

Private Sub Workbook_Open()
    UserForm1.Show
End Sub



AND
add this to Sheet1

Private Sub Worksheet_Activate()
    UserForm1.Show
End Sub



For your #2
This is code in UserForm5, Changed lines are highlighted

Private Sub CommandButton1_Click()
Dim i As Integer
Dim final As Integer

    For i = 2 To 1000
        If Sheet20.Cells(i, 1) = "" Then
            final = i - 1
            Exit For
        End If
    Next
    
    
    
    For i = 2 To final
        If UserForm4.ComboBox1 = Sheet20.Cells(i, 1) Then
            Sheet20.Cells(i, 1) = UserForm4.TextBox8
            Exit For
        End If
    Next
    
    UserForm4.ComboBox1 = ""
    
    UserForm5.Hide
    UserForm4.Hide
    
End Sub
0
Hi I do not know why is not working the code to modify the clients name

Help...
0
rizvisa1
Posts
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
770
Jun 10, 2010 at 01:25 AM
could you post the file with your updated code. and also could you give step by step process of update. please use example from the sheet
0
Thanks problem solved
0