OK Dan. Whenever you're ready is fine.
Mainform and multiple subforms search...
Collapse
X
-
NeoPa
now whats needs resolving is a code under the combo box for By Ministry search under afterUpdate control...on frm_MainMenu..t he search for subforms..thats what was always the case here..
after opening the db please click on the assets button on the main menu on the left then try to select a seach word from the first left combo box and observe the result. i have data on two search term "MOH and MOE" search using those from the combo box
regardsComment
-
I'm sorry Dan.
I had a quick look but didn't get the time to look in enough detail to be of any help. I still have it to do, but can't say when I will be able to. I'll try tonight, but I'm out every evening till Thursday, so may have to wait until Friday.
We'll see what we can manage.Comment
-
That's fine Dan.
I was out both of the last two evenings and didn't even get to turn on my PC.
I still have this thread as a saved page until I can get a chance to look it over. Bumping is not a problem though if ever you're curious to know where I'm at on it.Comment
-
You have the code handling this as :
Code:Private Sub cmbMinistryName_AfterUpdate() Dim strFilter As String With Me.SubForm.Form ' This assumes Handle is a text field strFilter = "[MinName] Like '" & Me.cmbMinistryName & "*'" .Filter = strFilter .FilterOn = True Call .Requery End With End Sub
The problem is your use of Me.cmbMinistryN ame in line #5. You probably think the value will be a name ("MOE" or "MOH"), but it's actually just the [minID] field, which is numeric.
Look at the design of cmbMinistryName.
Column Count = 2 (minID & minName)
Column Widths = 0;2.54cm
Bound Column = 1
That last is the important one. That means the value of the ComboBox (when referred to as in Me.cmbMinistryN ame) is the minID column. So, you get 1 instead of "MOH" & 15 instead of "MOE".
Try instead :
Code:Private Sub cmbMinistryName_AfterUpdate() Dim strFilter As String With Me.SubForm.Form ' This assumes Handle is a text field strFilter = "[MinName] Like '" & Me.cmbMinistryName.Column(1) & "*'" .Filter = strFilter .FilterOn = True 'Following line not actually required after setting .Filter 'Call .Requery End With End Sub
Having seen the database of course, I can say I was impressed by the design and workings of it.Comment
-
eeeh. programming is not a joke neh...i have never done VB at school i just got interested and started reading books and the outcome was fruitful.
thanks bout the design...i was confident but now u make me feel more confident and willing to do more.
thanks, its working now...im glad. now i have to work on the other combo boxes...
regards,LovelyComment
Comment