• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Prob in Finding Data in User Form

sha_m2

New Member
Sir, I am very very new, infact I never try to make any kind of program. This is my first attempt and what ever coding, i hv written is just a copy paste and modification according to my knowledge, sources available from the Internet and other ref.


I am able to add or enter data and store data in worksheet succuessfuly.


My prob is as under:


1. If i press Find button, it shows only one record (I cant search the record I want)

My aim is to either of this field i type initial word and it shows me the full records data set. (which is not functioning properly at all, Pl help me in this regard)


2. Pl suggest me if it is easy to use of combo box, radio button to work more easily.


my coding is like this.

'Private Sub CommandButton2_Click()

Private Sub Cmdadd_Click()


Dim iRow As Long

Dim ws As Worksheet

Set ws = Worksheets("Data")


'find first empty row in database

iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _

SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1


'check for a part number

If Trim(Me.TextBox1.Value) = "" Then

Me.TextBox1.SetFocus

MsgBox "Please enter a Computer Code number"

Exit Sub

End If


'copy the data to the database

ws.Cells(iRow, 1).Value = Me.TextBox1.Value

ws.Cells(iRow, 2).Value = Me.TextBox2.Value

ws.Cells(iRow, 3).Value = Me.TextBox4.Value

ws.Cells(iRow, 4).Value = Me.TextBox3.Value


'clear the data

Me.TextBox1.Value = ""

Me.TextBox2.Value = ""

Me.TextBox4.Value = ""

Me.TextBox3.Value = ""

Me.TextBox1.SetFocus


End Sub


Private Sub ComboBox1_Change()


End Sub


Private Sub CommandButton1_Click()

Dim x As String


x = TextBox1.Value


Dim i As Integer

Dim cell As Range

Dim ws As Worksheet

Set ws = Worksheets("Data")


i = 2


For Each cell In Range("a3:a999999")

i = i + 1

If cell = x Then

End If

Exit For

Next


'Me.TextBox1.Object = i

'Me.TextBox2.Value = i

Me.TextBox1.Value = ws.Cells(i, 1).Value

Me.TextBox2.Value = ws.Cells(i, 2).Value

Me.TextBox3.Value = ws.Cells(i, 4).Value

Me.TextBox4.Value = ws.Cells(i, 3).Value


End Sub


Private Sub CommandButton3_Click()

Unload Me

End Sub


Private Sub Label1_Click()


End Sub


Private Sub Label2_Click()


End Sub


Private Sub TextBox1_Change()

'use data, Next Row,2

End Sub


Private Sub TextBox2_Change()


End Sub


Private Sub UserForm_Click()


End Sub


3. Can I import data in this worksheet. I have couple of diff format file, like CSV,XLS and JPEG/TIFF, which contain same field.


Can anyone help me to sort out my above mentioned 3 prob. thanking you in advance.


Manish
 
Hi Manish ,


I am willing to help out , but I suggest it will be easier if you can upload your workbook and let me know exactly what you want.


If you do not wish to upload your workbook , but can send it to my email , please do so. My email ID is narayank1026@gmail.com


Narayan
 
Back
Top