i want a particlular calculation at the press of tab key i am using the following code but as i press the tab the cursor moves to the next text box but calculation is not done
tell me what to do
VB Code:
Private Sub Text17_KeyPress(KeyAscii As Integer) If KeyAscii = 9 Then Dim objConn As ADODB.Connection Set objConn = New ADODB.Connection objConn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\database\DB.mdb;Persist Security Info=False") Text18.Text = Text17.Text * Text14 Dim q As String q = "Select * from product where pname='" & Text24.Text & "'" Set rs2 = objConn.Execute(q) Text99 = rs2("pcs") & "" Text15 = Text17.Text \ Text99.Text & " " Dim a As Integer a = Text15 * rs2("pcs") Dim b As Integer b = Text17 - a Dim c As Double c = b / rs2("pcs(box)") Text3.Text = c Dim d As Integer 'MsgBox (c) End If




Reply With Quote