dcsimg
June 22, 2018
Hot Topics:

Visual Basic Database Tutorial - Part 4

  • November 19, 2002
  • By 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.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date