button value from table

SDB

Registered User.
Local time
Today, 23:23
Joined
Sep 16, 2004
Messages
39
Hi Guys and Girls,
Does anyone know if it is possible to have a button assigned a value from a table/query record, (I need to use a touchscreen so can't use a combobox.)

eg button one = record 1, button2 = record 2 etc when pressed the value of the record is passed to another field.

thanks for any help.
 
Buttons do not have any controlsource, so this one can be tricky for continous forms. Why don't you just use a list control? They work the same way as an combo box, except that you can see the list all the time and don't need to click that down-arrow. Plus you cannot write the value to a list control using the keyboard as you can to a combo box. But as long as you have a couple of options, a list control is perfect. The easiest way of implementing this in form design if you already have an combo box is just right-clicking the combo box, select Change to -> Listbox. Good luck!
 
Last edited:
Hi gizzu
thanks for the quick reply but unfortunatly the application is going to be used with a touch screen (no mouse or keyboard) so i need to use some form of a button instead of a listbox. its for sandwich labels, they just want to press a button to produce the label but be able to change the description if needed.
 
Yes, you wrote in your first post that you were using a touch-screen. I know you wrote that. Maybe I should explain more in detail what I mean:

A listbox is what you need if you want more than one button, and want to get the labels of the buttons from a table/query. Use the On_Click() Event of the listbox to catch the mouse click (or touch-screen click, I hope). Then use the Value property of the listbox to determine which line (button) was clicked (pressed). Then write your code for what would happen for the button clicks.

Alternatively, you could use a sub form with a textbox with a button next to it. But you can't take the label of a button from a table/query if you're going to view more than one record at a time.

HTH
 

Users who are viewing this thread

Back
Top Bottom