Multipage Query
Hi
I'm trying to use a multipage to help with input data quickly into a main spreadsheet. Design wise everything is fine, it's just i'm trying to calculate the total of each multipage(8 in all) to give a subtotal as the user tabs through each page. I've used some code that i picked up on from the discussion group but it only adds up page 1 and I need the same code to calculate pages 2 onwards. I've attached the code in case anyone can put me straight as I am unsure what I'm doing wrong!! Private Sub textbox2_keypress(ByVal keyascii As _ MSforms.ReturnInteger) If keyascii < Asc("0") Or keyascii Asc("9") Then Interaction.Beep keyascii = 0 End If End Sub Private Sub textbox3_keypress(ByVal keyascii As _ MSforms.ReturnInteger) If keyascii < Asc("0") Or keyascii Asc("9") Then Interaction.Beep keyascii = 0 End If End Sub Private Sub textbox4_keypress(ByVal keyascii As _ MSforms.ReturnInteger) If keyascii < Asc("0") Or keyascii Asc("9") Then Interaction.Beep keyascii = 0 End If End Sub Private Sub textbox5_keypress(ByVal keyascii As _ MSforms.ReturnInteger) If keyascii < Asc("0") Or keyascii Asc("9") Then Interaction.Beep keyascii = 0 End If End Sub Private Sub textbox6_keypress(ByVal keyascii As _ MSforms.ReturnInteger) If keyascii < Asc("0") Or keyascii Asc("9") Then Interaction.Beep keyascii = 0 End If End Sub Private Sub textbox7_keypress(ByVal keyascii As _ MSforms.ReturnInteger) If keyascii < Asc("0") Or keyascii Asc("9") Then Interaction.Beep keyascii = 0 End If End Sub Private Sub Calctotal() TextBox8.Text = CLng("0" & TextBox2.Text) + _ CLng("0" & TextBox3.Text) + _ CLng("0" & TextBox4.Text) + _ CLng("0" & TextBox5.Text) + _ CLng("0" & TextBox6.Text) + _ CLng("0" & TextBox7.Text) End Sub Private Sub userform_click() End Sub Look forward any comments |
All times are GMT +1. The time now is 03:30 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com