Access Database Homepage

Type keyword or phrase to search:

 

 

 


Access Database Homepage

The know how and power behind access database

Want to teach yourself Access? Free online guide at About Access Databases
 
How To Create Access Database Tables
The table is the container for your data in your access database. access databases.com click here to get free access database videos and lessons

How to do if...then statment for an access database?

Question: How to do if...then statment for an access database?

(Posted by: The Phantom on 2010-07-08 10:59:09)

I have a combo box that i linked to an access database which contain names.... i want to make if this username is selected then welcome him


Answers:

Posted by: Siezer on 2010-07-08, 11:15:50

Since the names are already listed in the combo box you can simply use something like this Private Sub Form_Load() With Combo1 .AddItem "user1 " .AddItem "user2 " .AddItem "user3 " End With End Sub Private Sub Combo1_Click() MsgBox "Welcome " & Combo1.Text & "! " End Sub

  

Posted by: Billion Dollar Boy on 2010-07-08, 11:20:09

Let's say you have a combo box (Combo0 ) with three names in it Ben Donna Adam If you select your drop down box, then right click and view properties - then go to the events tab and click the "afterupdate " event. Click the build button (...) and this will open up the VBA area. Add this code inside the afterupdate sub: If Me.Combo0.Text = "Donna " Then MsgBox ( "Welcome Donna ") End If This will give a message only if Donna is selected (remember to change the combo0 to the name of your combo box. If you want to send a message to anyone selected, instead of just Donna, use this code instead: MsgBox ( "Welcome " & Combo0.text)

  

Powered by Yahoo! Answers (R)


Back to Previous page

Google News will be listed here
Go Articles will be listed here

Bookmark Access Database Homepage


Want to teach yourself Access? Free online guide at About Access Databases

 

 
Sitemap | Terms of Use | Privacy Policy | Contact

© copyright 2010 Access Database.com, All Rights Reserved.

Legal Notice: This website is powered by Amazon®, Adsense, Clickbank®, Yahoo!® Answers and Youtube. All trademarks are copyrighted by their respective owners. Please read our terms of use and privacy policy.