Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
| FAQ | Members List | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #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)

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.

Reply With Quote
  #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


        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


Reply With Quote
  #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

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...

Reply With Quote
  #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

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"
    Me!Misstext = "Miss"
End If
End Sub

Reply With Quote
  #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

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
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 11:53 PM.

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