Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Populate a Userform from an existing Record.

I am making a database that will contain about 1500 records when it is
completed. I have need to go back into certain Records and make
corrections to the data. I have been able to select the record (by
searching for the Last Name) I want to change but I would like to
re-populate a userform with the existing data and then make any
necessary revisions. Then I will add the revised record back into its
original place.

I can't seem to get the info back into a userform so that my program
will run and make the changes to approprate cells. Any help would be
greatley appreciated.

I hope this is clear enough and someone with more programming knowledge
will be able to help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Populate a Userform from an existing Record.

You could...
Use a ListBox on the form filled with the 1500 records.
Selecting a ListBox item would add that item to a Textbox.
User would edit the Textbox and press a button which
would add the corrected text back to the database.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Dooley007"
wrote in message
I am making a database that will contain about 1500 records when it is
completed. I have need to go back into certain Records and make
corrections to the data. I have been able to select the record (by
searching for the Last Name) I want to change but I would like to
re-populate a userform with the existing data and then make any
necessary revisions. Then I will add the revised record back into its
original place.

I can't seem to get the info back into a userform so that my program
will run and make the changes to approprate cells. Any help would be
greatley appreciated.

I hope this is clear enough and someone with more programming knowledge
will be able to help.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Populate a Userform from an existing Record.

Dim rng as Range, res as Variant
Dim rng1 as Range
With worksheets("Sheet1")
set rng = .Range(.Cells(2,1),.Cells(2,1).End(xldown))
End with
res = Application.Match(me.Textbox1.Text,rng,0)
if not iserror(res) then
set rng1 = rng(res)
me.Textbox2 = rng1.offset(0,1)
me.Textbox3 = rng1.offset(0,2)
Else
msgbox me.Textbox1.Text & " was not found"
End if

if you have your "index" values loaded into a combobox, then use the
combobox1.ListIndex property to find the row.

--
regards,
Tom Ogilvy

"Dooley007" wrote in message
ups.com...
I am making a database that will contain about 1500 records when it is
completed. I have need to go back into certain Records and make
corrections to the data. I have been able to select the record (by
searching for the Last Name) I want to change but I would like to
re-populate a userform with the existing data and then make any
necessary revisions. Then I will add the revised record back into its
original place.

I can't seem to get the info back into a userform so that my program
will run and make the changes to approprate cells. Any help would be
greatley appreciated.

I hope this is clear enough and someone with more programming knowledge
will be able to help.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Populate a Userform from an existing Record.


Tom Ogilvy wrote:
Dim rng as Range, res as Variant
Dim rng1 as Range
With worksheets("Sheet1")
set rng = .Range(.Cells(2,1),.Cells(2,1).End(xldown))
End with
res = Application.Match(me.Textbox1.Text,rng,0)
if not iserror(res) then
set rng1 = rng(res)
me.Textbox2 = rng1.offset(0,1)
me.Textbox3 = rng1.offset(0,2)
Else
msgbox me.Textbox1.Text & " was not found"
End if

if you have your "index" values loaded into a combobox, then use the
combobox1.ListIndex property to find the row.

--
regards,
Tom Ogilvy

"Dooley007" wrote in message
ups.com...
I am making a database that will contain about 1500 records when it is
completed. I have need to go back into certain Records and make
corrections to the data. I have been able to select the record (by
searching for the Last Name) I want to change but I would like to
re-populate a userform with the existing data and then make any
necessary revisions. Then I will add the revised record back into its
original place.

I can't seem to get the info back into a userform so that my program
will run and make the changes to approprate cells. Any help would be
greatley appreciated.

I hope this is clear enough and someone with more programming knowledge
will be able to help.


Thanks guys for the replies. This will help a lot!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Populate a Userform from an existing Record.

This is what I did.
My user form actually pulled data from 2 different worksheets.
You could modify it to pull from your database record


Private Sub UserForm_Activate()
Worksheets("RFI LOG").Unprotect
' Read initial values from RFI LOG:
ActiveWorkbook.Sheets("RFI LOG").Activate
txtJobNum.Text = Cells(8, 3).Value
txtJobName.Text = Cells(8, 5).Value
txtContractor.Text = Cells(9, 3).Value

' Read initial values from Template:
Sheets("Template").Visible = True
ActiveWorkbook.Sheets("Template").Activate
txtAuthor.Text = Cells(10, 9).Value
txtSendTo.Text = Cells(11, 2).Value
txtCopyTo.Text = Cells(12, 2).Value
End Sub

On Dec 10, 8:48 pm, "Dooley007" wrote:
I am making a database that will contain about 1500 records when it is
completed. I have need to go back into certain Records and make
corrections to the data. I have been able to select the record (by
searching for the Last Name) I want to change but I would like to
re-populate a userform with the existing data and then make any
necessary revisions. Then I will add the revised record back into its
original place.

I can't seem to get the info back into a userform so that my program
will run and make the changes to approprate cells. Any help would be
greatley appreciated.

I hope this is clear enough and someone with more programming knowledge
will be able to help.


Reply
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
How to auto populate an invoice from data in an existing worksheet juliebythesea Excel Discussion (Misc queries) 5 October 28th 09 08:14 AM
Use existing table to populate a drop down list & create a new tab Etitan Excel Discussion (Misc queries) 1 November 1st 07 02:15 AM
Excel Template problem - update existing record [email protected] Excel Discussion (Misc queries) 0 January 26th 07 11:34 AM
VBA: Pull Record Into UserForm Mcasteel[_16_] Excel Programming 0 October 27th 04 01:58 PM
VBA: Pull Record Into UserForm Mcasteel[_10_] Excel Programming 2 October 26th 04 11:03 PM


All times are GMT +1. The time now is 02:28 PM.

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

About Us

"It's about Microsoft Excel"