I am using VBA with our ERP software. I have a form in VBA with a textfield. When the form kicks in the field is populated with a string.
I wanna do a couple of things. Firstly - I want the string to be highlighted when the form comes up.
Secondly, The string that is in my text field has to be copied to the db, I already have the code to write the string to a db, but after writing the string to a db I want to unload the form but I [red]cannot[/red] have a submit button on the form to do this. I want to copy the string to a db and unload the form When the user hits TAB.
I know how to write the value to the db, but I could not find a Lose_Focus event for my text box in this form, I guess its not available. So I was trying to use the KeyPress event, How do I catch the TAB and unload the form?
Here is the code I have --
I wanna do a couple of things. Firstly - I want the string to be highlighted when the form comes up.
Secondly, The string that is in my text field has to be copied to the db, I already have the code to write the string to a db, but after writing the string to a db I want to unload the form but I [red]cannot[/red] have a submit button on the form to do this. I want to copy the string to a db and unload the form When the user hits TAB.
I know how to write the value to the db, but I could not find a Lose_Focus event for my text box in this form, I guess its not available. So I was trying to use the KeyPress event, How do I catch the TAB and unload the form?
Here is the code I have --
Code:
txtBno is the text field.
Load frmBNo
frmBinNo.txtBno.Text = "some string"
frmBinNo.Show