When a command button is clicked is there a way to have a message box appear saying "Enter a number" which you type a number within that message box, hit ok, and then have that number appear in a text box?
When a command button is clicked is there a way to have a message box appear saying "Enter a number" which you type a number within that message box, hit ok, and then have that number appear in a text box?
Use the inputbox function instead of Msgbox.
From MS Access help:
Displays a prompt in a dialog box, waits for the user to input text or click a button, and returns a String containing the contents of the text box.
John
I am not too familiar with access, is there a certain code to do this?
and How do I get the number to appear in a specific textbox
You could also create your own message box, just make another form, set it to popup add the field from the table you want the data in and add an OK button. On the OK button afterupdate event add code to have it close the popup form and refresh the textbox on the main form so it reveals the data the user entered on the popup. Doing it this way you can customize the look of the message box.
In its simplest form your code would be something like:
Me![textboxName] = inputbox("Please enter a value:")
To ensure you get only numerics, you could use:
Me![textboxName] = val(inputbox("Please enter a value:"))
Now, where you put that code depends on what you are doing with the form, and how. But, from your description, it would be in the On-Click event of the command button.
John
Works great, thank you!