Form not cooperating

Sorry, just remembered that I hadn't replied to your post.

It would be easier if you upload a cut-down version of your db and I'll implement the option button and the first combo box, and you just follow suit.

By cut-down I mean, a copy of your db with:
* Confidential data removed
* Bogus data entered
* Irrelevant forms, queries, tables removed
* Compact & Repair > zip > upload.
 
Just had a meting to set up a dummy version of the dB. Let me get it ready and I will forward it to you once I am done.
 
What happened there, management agreed to you uploading something? ;)

I'll take a look in a few moments. If there are multiple forms, please mention the one to focus on.
 
I gave them the choice of getting help or scrapping the project. They chose to move forward.
 
That's a shame, I would have had less work to do :p

Right, I'll take a look later and give feedback.
 
Quickly refresh my memory, is it:

1. Option buttons > Employee > CCode > PCCode > PGCode > and CID
or
2. Option buttons > CCode > PCCode > PGCode > and CID?
 
Option Button --> CType two tables for CType

Then PGCode --> and PDCode --> to show results for CID in the "Last CID" ListBox.
 
You're missing CCode, is that not supposed to be part of the cascade?

Which tables are these? There's code in CCAH but nothing in Automated.
 
The tables "CCAH" and "CType" contain the codes for CType. The filter for the list box should be based on the selections made for CCode/PGCode/PDCode to give me a shortened list of CID's from the table "MasterCID".

Here are the event settings for CCode:
'sets the list for the first Combobox
Me.Combo142.RowSource = "SELECT [CCode].[CCode] " & " FROM CCode ORDER BY CCode;"
Me.Combo142.Requery

End Sub
Private Sub Combo142_AfterUpdate()
'Clears the second Combobox when the value of the
'first Combobox has changed
Me.Option123 = Null
Me.Combo142.Requery

End Sub
Private Sub Option123_AfterUpdate()
'sets the list for the second Combobox
'based on the selection in the OptionsButtons
Me.Combo142.RowSource = "SELECT [CCAH].[Year_Month] " & " FROM CCAH " & " ; "
Me.Combo142.Requery

End Sub
 
Ooops,...cut off some of the event procedure:

Private Sub Form_Load()
'sets the list for the first Combobox
Me.Combo142.RowSource = "SELECT [CCode].[CCode] " & " FROM CCode ORDER BY CCode;"
Me.Combo142.Requery

End Sub
__________________________________________
Private Sub Combo142_AfterUpdate()
'Clears the second Combobox when the value of the
'first Combobox has changed
Me.Option123 = Null
Me.Combo142.Requery

End Sub
_______________________________________
Private Sub Option123_AfterUpdate()
'sets the list for the second Combobox
'based on the selection in the OptionsButtons
Me.Combo142.RowSource = "SELECT [CCAH].[Year_Month] " & " FROM CCAH " & " ; "
Me.Combo142.Requery

End Sub
___________________________
 
Understood! When I say CCAH, I'm talking about the option button labelled CCAH. Aren't CCAH and Automated mutually exclusive? And if I remember, you mentioned that the CCode combo box is reliant on one of those options.
 
Correct. CCode ComboBox relies on the choice made in the option buttons. Option1 (Automated) pulls from the table [CCode] and Option2 (CCAH) pulls from table [CCAH].
 
evega6686, see attached. I think you misunderstood the meaning of cascading combo boxes that was initially proposed and that has been the confusion throughout this thread. What you wanted wasn't cascading combo boxes but rather, a listbox whose value is based on the selections made in the three combo boxes; the combo boxes in this case don't cascade, only the listbox does.

Secondly, if this form is supposed to be a search form then it should not be bound, even if it isn't, because of the changes your making in code, it should not be bound. Your listbox is based on the selections made in the combo boxes which are bound to the current record, any new selection must be saved for the listbox to reflect the correct value, otherwise it won't. It's counter productive having to save the data after each selection change. I have made the combo boxes and the listbox unbound.
 

Attachments

Users who are viewing this thread

Back
Top Bottom