Results 1 to 4 of 4
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Dim Statement for textbox using a numeric value

    I dont know what I am doing! I want to use this field to do calculations on.It is a textbox and has a value list of 0,15,30,45 named min
    I am trying to calculate the hourly rate of a selected value, lets say $10 an hour and when the user selects the minutes then the value will calculate out.
    bound control named min uses a value list with options of 0,15,30,45 I also have an unbound textbox named txtmin to store the value of that selection times the hourly rate for the control named myrate
    So, it's myrate * min and that value shows up in the textbox txtmin. Here is my code:

    Dim txtmin As varValue (Is This Right?)

    Select Case Me.min


    Case Is = "15" 'if user selects 15 minutes use this
    Me.txtmin = [myrate] * 0.25

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Wouldn't this work?

    Me.txtmin = Me.myrate * (Me.min/60)

    In any case, given what you're doing you don't have to declare a variable.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Thanks, that will work.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    No problemo.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Numeric overflow
    By slimjen in forum Forms
    Replies: 10
    Last Post: 10-19-2011, 01:26 PM
  2. Filtering for numeric value
    By Bear in forum Access
    Replies: 21
    Last Post: 07-31-2011, 05:08 PM
  3. Not In statement from textbox - help please
    By jclausen in forum Access
    Replies: 4
    Last Post: 02-03-2011, 05:27 PM
  4. Force numeric value
    By jgelpi16 in forum Programming
    Replies: 5
    Last Post: 01-24-2011, 12:37 PM
  5. Textbox IIF statement not working
    By jgelpi16 in forum Forms
    Replies: 2
    Last Post: 08-22-2010, 08:41 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums