PDA

View Full Version : Solved: 1st Form option button to 2nd FORM



whitewidow
02-21-2007, 12:16 PM
in my 1st form i have four option buttons and in the second form i have a textbox.

in the first form when a option button is selected then this should read from my worksheet and output the informtion to the second form.

so i have when option 1 is selected then that option should output the average price in the second form.

lucas
02-21-2007, 12:22 PM
Thanks for posting your question instead of relying on pm's whitwidow. Could you possibly post a sanitized version of your workbook to make it a little easier for us. Otherwise we have to create the whole thing from scratch.

If not possible could you tell us where on the sheet the average price is located(column)

Also there has been much discussion lately about multiple forms....have you considered a multipage form?

whitewidow
02-21-2007, 12:28 PM
Thanks for posting your question whitwidow. Could you possibly post a sanitized version of your workbook to make it a little easier for us. Otherwise we have to create the whole thing from scratch.

If not possible could you tell us where on the sheet the average price is located(column)

Also there has been much discussion lately about multiple forms....have you considered a multipage form?

ok in house form when user clicks option 1 then the average price should appear in the calcul form

Charlize
02-21-2007, 02:19 PM
frmcal form by on exit on txthaver box. So when you fill in a value in grey box, on exit the value will be calculated.Private Sub txthaver_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Me.txthdiff.Value = (Val(Mid(Me.txtcurrent.Value, 3, Len(Me.txtcurrent.Value) - 3)) + Val(Me.txthaver.Value)) / 2
End Sub
Never mind.

lucas
02-21-2007, 02:47 PM
Try this code for the initialize statement on the form frmcal

Private Sub UserForm_Initialize()
Worksheets("House").Select
Me.txtcurrent.Text = frmhouse.txthprice.Text
If frmhouse.ophtwo.Value = True Then
Me.Label7.Caption = Format(Range("B34").Value, "? #,###,##0")
ElseIf frmhouse.ophthree.Value = True Then
Me.Label7.Caption = Format(Range("B35").Value, "? #,###,##0")
ElseIf frmhouse.ophfour.Value = True Then
Me.Label7.Caption = Format(Range("B36").Value, "? #,###,##0")
ElseIf frmhouse.ophfive.Value = True Then
Me.Label7.Caption = Format(Range("B37").Value, "? #,###,##0")
End If
End Sub

lucas
02-21-2007, 02:49 PM
whoops sorry. I changed your textbox on that form to a label...looks nicer you might try it.

everywhere I have me.label7.caption in the code above you will have to change it to me.txthaver.value or me.txthaver.text.

lucas
02-21-2007, 02:53 PM
here's your file back

whitewidow
02-21-2007, 03:29 PM
i have already changed it sorted the coding out.

thanks alot lucas

lucas
02-21-2007, 03:33 PM
Your very welcome..sorry it took so long.

whitewidow
02-21-2007, 03:38 PM
LUCAS, you was talking about multiform what was that about

lucas
02-21-2007, 03:45 PM
Multi-page......see attached.

whitewidow
02-21-2007, 04:20 PM
ok thanks alot lucas