LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA: Pull Record Into UserForm


I have a worksheet full of Customer Information. A simplified recor
would like somewhat like the following:

_*Lname,_Fname,_Mname,_SSN,_info1,_info2,_info3*_

I want to pull the customers LName, FName, SSN, and info into my for
based upon the customers SSN.

So the end user will type in the SSN, and all other cells associate
with that customer will be inserted into either txtboxes or labels o
the user form.

Im getting an error on the code I am working on and could use you
expertise.

_Here_is_the_code_I_have_so_far._

Private Sub cmdSelectRecord_Click()

Dim LName As String
Dim FName As String
Dim MName As String

Dim rngActive As Range
Set rngActive = Application.ActiveCell

Dim iRow As String
Dim CustSSN As String

'Fill variable with User Inputed Cust. SSN
CustSSN = txtCustSSN

iRow = WorksheetFunction.Match(CustSSN
Worksheets("sheet1").Range("f27:f307"), 0)

If iRow = 0 Then
MsgBox "Customer SSN Was Not Found"
Else
MsgBox "Record Found."

'Move Customer info from Worksheet to current form
'lblLName.caption = rngActive.offset(0, -3).value
'lblFName.caption = rngActive.offset(0, -2).Value
'lblMiddle.caption = rngActive.offset(0, -1).value

End If

End Su

--
Mcastee
-----------------------------------------------------------------------
Mcasteel's Profile: http://www.excelforum.com/member.php...fo&userid=1569
View this thread: http://www.excelforum.com/showthread.php?threadid=27247

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need to have a record number change for every record Puget Sound Courier Service Excel Discussion (Misc queries) 1 July 12th 09 03:32 PM
Open new record with selected fields from previous record Design by Sue Excel Discussion (Misc queries) 1 June 12th 09 02:24 PM
Find record by multi criteria in userform MP Excel Discussion (Misc queries) 0 November 3rd 08 04:01 PM
Need help autopopulating next new record with previous record data Harry S[_3_] Excel Programming 2 October 1st 03 10:59 PM
pull down menu on userform Tom Ogilvy Excel Programming 4 August 13th 03 12:49 AM


All times are GMT +1. The time now is 04:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"