By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,384 Members | 671 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,384 IT Pros & Developers. It's quick & easy.

Hi Everyone, I Need Help

P: 1
hi all
I have two qustions
how can I save the values of checkbox into database in visual basic 6.0?

how can I make a search using combobox?

thanx
Apr 24 '07 #1
Share this Question
Share on Google+
1 Reply


100+
P: 375
hi all
I have two qustions
how can I save the values of checkbox into database in visual basic 6.0?

how can I make a search using combobox?

thanx
1. In MS-Access the choose the datatype of your field as Yes/No and save it.
2. As far as combo box is concerned you have to populate the combo box first.


[HTML]If MyRs.State = adStateOpen Then MyRs.Close
MyRs.Open "select billno from invoice order by billno", Mycon, adOpenDynamic, adLockOptimistic
cboBILLNO.Clear
If MyRs.BOF = False Then
Do Until MyRs.EOF = True
cboBILLNO.AddItem Trim((MyRs("billno")))
MyRs.MoveNext
Loop
MyRs.MoveFirst
Else
MsgBox "No Records"
End If
MyRs.Close[/HTML]
Thereafter search should be used. This should be preferably used in key combo's click or key up event

[HTML] If MyRs.State = adStateOpen Then MyRs.Close
MyRs.CursorLocation = adUseClient
MyRs.Open "select * from invoice where billno='" & Trim(cboBILLNO.Text) & "'", Mycon, adOpenDynamic, adLockOptimistic
If Trim(cboBILLNO.Text) = "" Then
If MyRs.RecordCount = 0 Then
MsgBox " No Records yet"
MyRs.Close
Exit Sub
Else
txtAM.Text = MyRs("amount")
txtTT.Text = MyRs("totaltax")

End If
MyRs.Close[/HTML]
Apr 24 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.