p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access (http://p2p.wrox.com/forumdisplay.php?f=18)
-   -   Converting 2 txt boxes to a double number (http://p2p.wrox.com/showthread.php?t=95250)

Terminalcycle November 25th, 2015 08:13 PM

Converting 2 txt boxes to a double number
I am trying to read 2 txt boxes from a form and convert the data to a number (example "5" in first txt box and "Giga" in second txt box to return "5000000000") and update a table with this number. I am a novice with access 2010.

txt box 1 is called Pre1
txt box 2 is called Pre1Unit
Field in table is called PreValue

Any help on this is very much appreciated.
Thank you.

malcolmdixon November 29th, 2015 08:44 AM

1 textbox and 1 combobox to a double number

If you haven't managed to sort this yet, here's one solution.

I'd use a combobox for pre1unit with 2 columns, set a value list 1000000, "Mega", 1000000000, "Giga" etc. Hide the first column by setting its size to 0cm in Columns Widths. Set Limit to List to Yes.

Set the AfterUpdate events of the textbox and combobox to calculate the prevalue:


Private Sub UpdatePreValue()
    Me.TextPreValue.Value = Me.TextPre1.Value * Nz(Me.ComboPre1Unit.Value, 0)
End Sub

I hope that helps you out.


Terminalcycle November 30th, 2015 03:56 PM

Thank you
I knew there was a simple way to fix it that I just didn't know. Thank you for your help.

All times are GMT -4. The time now is 09:29 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.