Results 1 to 3 of 3
  1. #1
    HotelierDream is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Dec 2020
    Posts
    31

    Use Command Buttons to add text to Textbox

    Hello All,

    So I would like to create a calulator form in my DB. (I know I could create a command button to open windows calulator but my client is very specific) I am starting our but making my buttons. How would I program the buttons to add text to the textbox without deleting what is currently in the textbox.

    In Example:

    If I press the command button 1 I want the textbox to display 1


    If I then press the command button + I want the text box to display 1+ and so on...

    Also, anyone have a idea on how to use a command button to evaluate a equation in a textbox and display the result in said textbox? I would think I would use a vba code to make the equation a tempvar and then find the solution to the tempvar and make tempvar2 and finally make textbox1 = Tempvar2 .

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    you would just keep concatenating the strings

    me.MyTextBox = me.MyTextbox & me.MyButtonValue



    here's a tutorial on making a calculator https://www.youtube.com/watch?v=l5vsqWPdiLE
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  3. #3
    HotelierDream is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Dec 2020
    Posts
    31
    Perfect! Thank you so much! I saw that tutorial but it didnt make sense, I am figuring it out step by step on input side first then ill see if I can use some of the code in the video.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-20-2017, 08:16 AM
  2. command buttons
    By hijack61 in forum Access
    Replies: 4
    Last Post: 11-19-2011, 04:59 PM
  3. Command Buttons
    By BLD21 in forum Access
    Replies: 2
    Last Post: 05-10-2011, 06:27 AM
  4. Command Buttons
    By Rosier75 in forum Access
    Replies: 3
    Last Post: 03-09-2011, 11:59 AM
  5. Command buttons
    By maintt in forum Forms
    Replies: 3
    Last Post: 08-03-2010, 09:52 AM

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