|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
Just include the Is Null in your Select statement WHERE clause
WHERE (((Protocol.[A)=[Forms]![Audit]![A])) OR ((([Forms]![Audit]![A]) Is Null )) lwells |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > selecting fields in combo boxes based on choices made in preceding combo boxes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|