Feb 26, 2009 #1 Fekri Programmer Jan 3, 2004 284 IR Hi to all, I have a calculation result on my form and I want to create a button command to make the result Round to 500 or 1000. for example: result Round 1350 1500 1780 2000 340 500 910 1000 any one can help me? thanks Ali Thanks & Good Luck Ali Fekri
Hi to all, I have a calculation result on my form and I want to create a button command to make the result Round to 500 or 1000. for example: result Round 1350 1500 1780 2000 340 500 910 1000 any one can help me? thanks Ali Thanks & Good Luck Ali Fekri
Feb 26, 2009 1 #2 JBinQLD Programmer Aug 2, 2008 452 AU G'day Ali I've assumed your control are called txtIn and txtOut: Code: Private Sub BtnRndTo500_Click() Dim intResult As Integer intResult = CInt(Me!txtIn / 500) Me!txtOut = intResult * 500 End Sub Hope that helps, works perfectly with your examples. JB Upvote 0 Downvote
G'day Ali I've assumed your control are called txtIn and txtOut: Code: Private Sub BtnRndTo500_Click() Dim intResult As Integer intResult = CInt(Me!txtIn / 500) Me!txtOut = intResult * 500 End Sub Hope that helps, works perfectly with your examples. JB
Feb 28, 2009 Thread starter #3 Fekri Programmer Jan 3, 2004 284 IR Thanks so much it was so perfect. Thanks & Good Luck Ali Fekri Upvote 0 Downvote