April 20, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

Visual Basic Database Tutorial - Part 4, Page 2

  • November 19, 2002
  • By Karl Moore, Karl Moore
  • Send Email »
  • More Articles »

Right, fellow Visual Basic geeks - this is the section which separates the boys from the men, the girls from the women, and that dodgy unknown down the street from his even dodgier looking brother. Yes, were about to access a database completely in code! Muhahahaha!!

[Ed: Mr Producer, are you SURE we cant cut his contract early?]

The annoying customer services department is on the phone. Again. Theyd like a program into which they can tap a customer ID and have it display the total number of orders for that customer, along with the last order date. Why? To calculate the amount of discount to give, apparently.

So lets start by designing our wizzy Visual Basic form. Heres something I prepared a little earlier:

Quickly knock together the above in your copy of Visual Basic. Ive not set any special properties, just added a few labels and text boxes.

Ive named my three text boxes -

  • txtCustID - the one that holds the customer ID
  • txtTotalNumber - will display the total number of orders
  • txtLastDate - will display the last order date

If you stick with these names, itll make code writing much easier later in this tutorial.

So thats the design out of the way... now we need to think about code.





Page 2 of 8



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Sitemap | Contact Us

Rocket Fuel