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: 122
Default userform problem

Hi experts,

I have a very urgent problem getting saved data from a sheet into the
txt_boxes in my userform.
I use 2 userforms.
- userform1 called startformulier
- userform2 called open_form
I have a few sheets called:
- staffelberekening
- database

Startformulier is used by the user to input all the data.
On this userform i have the buttons 'save' and 'open'
The save button saves all the data from the userform on a seperate sheet
caled 'database'
On the 'startformulier' form i have a lot of txt_boxes and here's the problem.


if i open a company from the 'database' sheet,
- all the txt_boxes that do not have a controlsource are not filled with
data from the databasesheet.
- all the txt_boxes that do have a controlsource in the 'calc' sheet are
updated !

Here is part of the code i use to open a company:

Private Sub but_ok_klantkeuze_Click()
Dim rng As Range
Dim klantmatrix As Range
Set klantmatrix = Worksheets("database").Range("A2:AZ1500").Find(kla ntkeuze)
1 If Not klantmatrix Is Nothing Then
2 Sheets("staffelberekening").Range("J3") =
Worksheets("database").Cells(klantmatrix.Row, klantmatrix.Column)
3 Sheets("staffelberekening").Range("J5") =
Worksheets("database").Cells(klantmatrix.Row, klantmatrix.Column + 1)
4 Sheets("staffelberekening").Range("J4") =
Worksheets("database").Cells(klantmatrix.Row, klantmatrix.Column + 2)
5 Sheets("staffelberekening").Range("D9") =
Worksheets("database").Cells(klantmatrix.Row, klantmatrix.Column + 3)
6 cbo_bepaling_rr = Worksheets("database").Cells(klantmatrix.Row,
klantmatrix.Column + 4)
7 If cbo_bepaling_rr = "0,03" Then
8 Worksheets("staffelberekening").Range("D8") = "3%"
9 Else: Worksheets("staffelberekening").Range("D8") = "4%"
10 End If
11 Sheets("staffelberekening").Range("J6") =
Worksheets("database").Cells(klantmatrix.Row, klantmatrix.Column + 5)
12 Sheets("staffelberekening").Range("J7") =
Worksheets("database").Cells(klantmatrix.Row, klantmatrix.Column + 6)
13 txt_stijgingsal = Worksheets("database").Cells(klantmatrix.Row,
klantmatrix.Column + 7)
14 Worksheets("staffelberekening").Range("J9").Value = txt_stijgingsal
/ 100
end sub

As you can see, i use two different statements to fill cells or txt_boxes.
The txt_boxes that have a controlsource are automitically updated when i open
a company ande the data is put in the 'staffelberekening' sheet.
however, because some txt_boxes do not have a controlsource, i try to fill
them
directly from the database sheet (see line 13 for example)
If i put in a msgbox line after for example line 13 giving me the
txt_stijgingsal, i get the right value (number) but it does not display on
the form.
Can you help me get all the data in the userform please?
Thanks,
Pierre


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1
 
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
Userform problem? law Excel Discussion (Misc queries) 0 December 3rd 07 07:54 PM
userform problem TUNGANA KURMA RAJU Excel Discussion (Misc queries) 0 August 10th 06 04:43 AM
Userform from a Userform Problem Adrian Excel Programming 1 October 12th 05 04:57 PM
SOme problem on VBA Userform allissonlu Excel Programming 2 August 13th 04 01:34 AM
Userform Problem Todd Huttenstine Excel Programming 2 February 15th 04 09:54 PM


All times are GMT +1. The time now is 01:17 AM.

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"