Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access 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 14th, 2005, 02:04 PM
USCitizen USCitizen is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 19 USCitizen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 21 m 37 sec
Reputation Power: 0
selecting fields in combo boxes based on choices made in preceding combo boxes

in my a2k database, we'll say there are three controls (combo boxes) called 'A', 'B' and 'C' for the sake of simplicity. they are to be entered in the alphabetic sequence. when a value in 'A' is selected from the dropdown list on the form (which we'll call 'Audit'), the values that can be selected from th e dropdown list for 'B' are supposed to be limited to just the one which was selected in 'A'. for 'C' the restraint is that the values allowed to appear in the drop down list are just those having matches in the values chosen for the 'A' and 'B' controls.

while this is working fine, there is a small snag. things do not work when the value the user picks from 'A' is a blank.

looking at the row source for 'B',

SELECT Protocol.[B]
FROM Protocol
WHERE (((Protocol.[A)=[Forms]![Audit]![A]))
ORDER BY Protocol.[B];

the afterupdate events for A and B are

Private Sub A_AfterUpdate()
Me.A.Requery
Me.B.SetFocus
Me.B = " "
Me.B.Requery
Me.C = " "
Me.C.Requery
End Sub

Private Sub B_AfterUpdate()
Me.B.Requery
Me.C.SetFocus
Me.C = " "
Me.C.Requery
End Sub


is this something fundamentally quirky about a2k or is there some workaround?

Reply With Quote
  #2  
Old January 15th, 2005, 10:51 AM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Just include the Is Null in your Select statement WHERE clause

WHERE (((Protocol.[A)=[Forms]![Audit]![A])) OR ((([Forms]![Audit]![A]) Is Null ))

lwells

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > selecting fields in combo boxes based on choices made in preceding combo boxes


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT