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

visual basic newbie help!!!

P: 1
I was making a program, a simple passbook, but I'm kinda new to ADODB...I have a database in MS Access.

In my program, I have to type in the account number then by pressing enter key, the name of the owner of the account number and their balance will appear on different textboxes...can anyone help me out??
Oct 21 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 5K+
P: 8,127
You simly need to open the recordset on the desired event. Pass the account number in the SQL by selecting from the textbox.

sample code

Expand|Select|Wrap|Line Numbers
  1. SqlStr ="select name ,balance from acc_table where account_number  =" & val(trim((textaccnum.text))
then assign the value of the recordset to the desired textboxes

Expand|Select|Wrap|Line Numbers
  1. txtname.text=iif(isnull(rs(0)),"",rs(0))
  2. txtbalance.text= iif(isnull(rs(0)),"",rs(0))

hope the above sample code solves your problem.
Oct 21 '07 #2

Post your reply

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