HCBBS Forum (English)
Submit Chemical Projects / Find Solutions
Amplify Your Requirements on a Broader Chemical Platform *Engineering · Technology · Equipment · Solutions*
Submit Request

Issues encountered in VBA programming

2009-02-20View Original

Thread Content

In VBA, how can the value of TextBook be assigned to a spinbutton, so that it changes as the value of TextBook changes? It’s urgent; I hope experts can give me some advice! Thank you! To solve this problem, I wrote the following program myself, but it doesn’t work. Could everyone please take a look and see if the program is correct? Thank you! Private Sub TextBox1_Change() Dim NewVal As Integer NewVal = Val(TextBox1.Text) If NewVal >= SpinButton1.Min And _ NewVal
Reply #22009-02-21
The code should be written under Form, I guess. It seems the event code for SpinButton1 should also be written as Private Sub SpinButton1_Change() TextBox1 = SpinButton1.Value End Sub
Reply #32009-02-21
I just tried it, and indeed, half of it is missing. Thank you! I had placed this line in another location originally; haha. But you’re missing something – it should be Private Sub SpinButton1_Change() TextBox1.Text = SpinButton1.Value End Sub
Reply #42009-03-09
Actually, the Text property of the TextBox control is default; it makes no difference whether it is specified or not. But for clarity, it’s better to include it

Submit a Project

**Looking for Chemical Technology, Equipment & Solutions?** No Registration Required Broader Platform Exposure | Global Chemical Service Provider Connections

Submit Request — Free Consultation

Disclaimer

This is an automated machine translation of the original thread. Some technical terms may have inaccuracies; the original text shall prevail. Click "View Original" at the top right to access the source page, which supports IP-based automatic real-time language translation. Please watch out for contact details and sales inducements to prevent fraud. All content and translations are for reference only, representing solely the poster's personal views. For enquiries, email service@hcbbs.com.