Frames on Form

U

Ueli Werner

Hi newsgroup

I have a form and I am working with frames on my form.

When I change from one frame to the other on my form, data will not be
written on excel cell. The value of the textbox also turn back to the
original value (I think that's because the value is not written to the
cell).

So. I have to use frames and I did some test on handling event of the
frames but this seems to complicated.

Isn't there a possibility to upate field after the frame_exit event or are
there any other solutions?

Thanks for every help.

Ueli
 
P

Peter T

Frames have Enter/Exit events, sounds like the Exit event will help you

Regards,
Peter T
 
U

Ueli Werner

Maybe

But how can I force the textbox to write down to the cell?

Thanks alot

Ueli
 
P

Peter T

In a new form put two textboxes in a frame, also put another control (say a
button)somewhere on the form but not in the frame.

Private Sub Frame1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim s As String
s = Me.TextBox1.Text
If Len(s) Then Range("A1") = s
s = Me.TextBox2.Text
If Len(s) Then Range("A2") = s
End Sub

type some text into both textboxes and click then click the button (to exit
the frame)

Regards,
Peter T
 
U

Ueli Werner

Hi Peter

Is it necesarry to write this way to cell (Range... = s)? I have a
ControlSource on the textboxes. Isn't it possible to manually tell the
textbox to update to the cell?

Regards

Ueli
 
P

Peter T

If you have assigned the ControlSource property you don't need to do
anything at all, the cell should update automatically when you exit the
textbox. The fact it's ion a Frame is not relevant.

Personally I'd prefer to get the cell contents when the form loads and write
to the cell if/as the Textbox changes, perhaps after some validation.

What is the problem.

Regards,
Peter T
 
U

Ueli Werner

Hi Peter

The Exit-Event is not called, because the textbox is in the frame.

Regards

Ueli
 
P

Peter T

Before & After update events will fire irrespective as to whether the
textbox is on a frame or not. But I still don't follow, because of your
Controlsource that will update the cell. You do not need to do anything
(assuming you do not need to validate the text.

Otherwise, the before/after update events and the frame exit events are all
available to you.

It's difficult to understand, try and explain with details.

Regards,
Peter T
 
U

Ueli Werner

Hi Peter

I entered a Form.Repaint on the Exit of the Frame an everything works fine.

Thanks for your support!

Regards

Ueli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top