Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 25th, 2015, 08:13 PM
Registered User
Points: 13, Level: 1
Points: 13, Level: 1 Points: 13, Level: 1 Points: 13, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
Reply With Quote
  #2 (permalink)  
Old November 29th, 2015, 08:44 AM
Authorized User
Points: 346, Level: 6
Points: 346, Level: 6 Points: 346, Level: 6 Points: 346, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2010
Posts: 61
Thanks: 0
Thanked 13 Times in 13 Posts
Default 1 textbox and 1 combobox to a double number

Hi,

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:

Code:
Private Sub UpdatePreValue()
    Me.TextPreValue.Value = Me.TextPre1.Value * Nz(Me.ComboPre1Unit.Value, 0)
End Sub
I hope that helps you out.

Malc.
Reply With Quote
  #3 (permalink)  
Old November 30th, 2015, 03:56 PM
Registered User
Points: 13, Level: 1
Points: 13, Level: 1 Points: 13, Level: 1 Points: 13, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thank you

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
find number of lines in .txt file dgr7 Beginning VB 6 8 July 16th, 2014 05:11 AM
How to separate double number draganp71 Visual Basic 2008 Essentials 2 April 27th, 2010 04:11 AM
converting double to text in editbox rupali_mb Visual C++ 1 February 11th, 2007 12:14 PM
Converting number to hh:mm dlyles Beginning VB 6 8 September 19th, 2006 12:27 PM
Converting a string to a number steve456 Javascript How-To 2 November 17th, 2003 06:01 PM



All times are GMT -4. The time now is 11:22 PM.


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