Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 28th, 2008, 08:42 AM
Registered User
 
Join Date: Mar 2008
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Count in combo box(display results in text box)

Hi!
I have a combobox (Title) that shows the title(i.e. Mr / Mrs / Miss etc .....). I have a text box at the bottom of this to keep track of how many Mr(s),Mrs(s) etc i have selected.i.e. When i select Mr for the first time and enter his details and again for the second time and enter another persons details,it should show in the text box the number 2.Which shows that i have selected the title Mr 2 times..

Pliz help me how tofigure this out in MS Access form.

  #2 (permalink)  
Old March 31st, 2008, 05:58 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default

him

        you to check weather all the data's are in one table and this try to get in qry or in VB coding to calculate the total no. of items which you are selecting in the combo box . this should be done in onChange or afterupdate event ....
 try this if you find difficult we ill provide the Code or query idea



anukagni

  #3 (permalink)  
Old April 1st, 2008, 02:12 AM
Registered User
 
Join Date: Mar 2008
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Anukagni,I have everything in one table and one form.Here is the case:My table is called registration,from is Regform,combo box called genderCombo and up to 4 text boxes being Proftext,Misstext,Mrtext and Mstext.e.g. If i select Professor for the 1st time from the list in combo box,it should display 1 in Protext.If i do it for 2nd and 3rd,it should increment the number to 3 in the same textbox.
Pliz help...






  #4 (permalink)  
Old April 2nd, 2008, 07:20 AM
Registered User
 
Join Date: Mar 2008
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried the code below but it only displays what i have selected from combo box into textbox.(i.e. if i select Prof,it display Prof in the text box instead of number 1, when i select it for the first time).
NB:I tried it using Prof and Miss only.

Private Sub genderCombo_AfterUpdate()
 If Me!genderCombo = "Prof" Then
    Me!Proftext = "Prof"
 Else
    Me!Misstext = "Miss"
End If
End Sub




  #5 (permalink)  
Old April 4th, 2008, 07:08 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Do you need to keep this count after the form is closed or do you just want to count how many titles you entered for this session and then NOT keep that number for future use?

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate a text box from a combo box value dnf999 Access VBA 7 February 6th, 2012 02:24 PM
Combo box to display items from parent combo box Gini Visual Studio 2008 0 June 18th, 2008 12:30 AM
Help! combo box results dstein4d Access VBA 1 February 6th, 2006 09:13 AM
Combo box and Text box Rudner Access VBA 4 November 16th, 2004 02:57 PM
Combo Box and Text Box Rudner Beginning VB 6 1 November 8th, 2004 04:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.