Database Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesDatabase Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 29th, 2009, 01:57 PM
Bijaya Bijaya is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2009
Posts: 18 Bijaya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 19 m 40 sec
Reputation Power: 0
Access 2007 Combo Box within Form

Hi There,

I'm a bit of a novice in terms of access 2007 and know nothing about VBA. I was hoping someone could help me out with

I have created a table called Membership. It's fields include firstname, lastname, address, telnumber, Membership_Type and Group_Membership_ Type etc .

I have also created a form from this table. In this form Membership_Type and Group_Membership_Type are Combo Box. Their Row sources are (Individual and Group) and
( Collerative, sustaining and patron) respectively.

I want to make "Group_Membership_Type " visible only when Membership_type = "Group"

To accomplish this I have written code at the change event of membership_Type

Like this :

Private Sub Membership_Type_Change()


If [ Membership].[Membership Type] = "Group" Then


[ Membership].[Collective Membership Type].Visible = "true"

Else
[ Membership].[Collective Membership Type].Visible = "false"

End If
End Sub


I am not able to get the result.

Can someone please tell me how it's done? sorry if it sounds a little simple to some of you, but it your reply would be very helpful.

thanks

Reply With Quote
  #2  
Old January 29th, 2009, 05:01 PM
AlanSidman's Avatar
AlanSidman AlanSidman is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Location: Lake County, IL
Posts: 240 AlanSidman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 15 h 49 m 19 sec
Reputation Power: 11
Posted in error

Reply With Quote
  #3  
Old January 30th, 2009, 10:15 AM
AlanSidman's Avatar
AlanSidman AlanSidman is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Location: Lake County, IL
Posts: 240 AlanSidman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 15 h 49 m 19 sec
Reputation Power: 11
Code:
Like this :

Private Sub Membership_Type_Change()


If [ Membership].[Membership Type] = "Group" Then


[ Membership].[Collective Membership Type].Visible = "true"

Else
[ Membership].[Collective Membership Type].Visible = "false"

End If
End Sub


Think you need to change to AfterUpdate event and
Code:
If me.membership_Type ="Group" Then
me.Collective_Membership_Type.visible= True
Else
me.Collective_Membership_Type.visible = False
End if


A suggestion for field names. Avoid using spaces in field names. It will only cause aggravation in the future. You need to remember to either square bracket or use underlines. If you use a convention like MembershipType or CollectiveMembershipType you are less likely to have coding issues in the future.

Alan

Reply With Quote
  #4  
Old February 2nd, 2009, 06:03 PM
Bijaya Bijaya is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2009
Posts: 18 Bijaya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 19 m 40 sec
Reputation Power: 0
Access 2007 combo Box Within Form

Alan, Thank for the suggestion. Code works fine, but I like to know why I need to use "Afterupdate" event.



Thank you
Bijaya

Reply With Quote
  #5  
Old February 3rd, 2009, 11:57 AM
AlanSidman's Avatar
AlanSidman AlanSidman is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Location: Lake County, IL
Posts: 240 AlanSidman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 15 h 49 m 19 sec
Reputation Power: 11
I use afterupdate because I want the script to fire after I move to the next control, ie. leave the control that has the script.

Alan
__________________
Alan Sidman
__________
If I helped you, I'd like to know. Click on the icon next to the thread number and tell me.

Reply With Quote
  #6  
Old February 16th, 2009, 04:07 PM
Bijaya Bijaya is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2009
Posts: 18 Bijaya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 19 m 40 sec
Reputation Power: 0
Access 2007 ComboBox Within Form

Thank you AlanSidman for your tesponse.

Bijaya

Reply With Quote
  #7  
Old July 30th, 2009, 06:35 PM
thomas398 thomas398 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 1 thomas398 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 32 sec
Reputation Power: 0
Combo box on subform

I'm new to access 2007 forms and I'm sure this is an easy question

I want to pick a program in one box, the other box gives the matching price. The boxes are on a subform bound to an invoice table. The program-price combinations are on a seperate lookup table (thec_Program).

This code works on the subform on the price box:
SELECT THEC_Program.Program_Cost, THEC_Program.ID, THEC_Program.Program
FROM THEC_Program
WHERE (((THEC_Program.ID)=[Forms]![SUBFORMNAME]![Program]));

When a tab in the main form get a parameter error, so changed to this

SELECT THEC_Program.Program_Cost, THEC_Program.ID, THEC_Program.Program
FROM THEC_Program
WHERE (((THEC_Program.ID)=[Forms]![FORMNAME]![Program]));
I'm new to access 2007 forms and I'm sure this is an easy question:



I want to make a selection in one combo box and have the other show the matching info (program => program_cost). The bound boxes are on a subform for an invoice table. The program-price combinations are on a seperate lookup table Thec_Program.



This code on the program_cost box works when only the subform is open :



SELECT THEC_Program.Program_Cost,THEC_Program.Program,
THEC_Program.ID
FROM THEC_Program
WHERE (((THEC_Program.ID)=[Forms]![SUBFORMNAME]![Program]));


When the full form is open, the subform is a tab and the above code returns a parameter error it doesnt recognize the subformname.

So I chage to this:

SELECT THEC_Program.Program_Cost, THEC_Program.ID, THEC_Program.Program
FROM THEC_Program

WHERE (((THEC_Program.ID)=[Forms]![FORMNAME]![Program]));

No parameter error but the drop down is blank.... Why is query coming back blank?

I have an AFTERUPDATE on the program box. On the subform this allows for multiple changes.

Private Sub Program_AfterUpdate()
Me.Program_Cost = Null
Me.Program_Cost.Requery
Me.Program_Cost = Me.Program_Cost.ItemData(0)
Thanks for any help.


Thanks for any help.

Reply With Quote
  #8  
Old June 19th, 2010, 12:44 PM
wreniaPleni wreniaPleni is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2010
Location: United States
Posts: 2 wreniaPleni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 8 sec
Reputation Power: 0
Send a message via ICQ to wreniaPleni
Betting on sports?

The lakers defeat the celtics in game 7 on the this year nba finals. I dropped $150 on the game, you folks bet on sports? Any sort of tricks for novices?

Reply With Quote
  #9  
Old June 25th, 2010, 10:15 PM
Alieceissuera Alieceissuera is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2010
Location: U.S.A
Posts: 2 Alieceissuera User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 46 sec
Reputation Power: 0
Send a message via ICQ to Alieceissuera
Brazil vs Portugal?

Did you guys catch the sad game in between Brazil and Portugal in the 2010 WC? I truly think this is unsportsly actions and should be punished. What’s your opinion?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesDatabase Development > Access 2007 Combo Box within Form


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap