Type mismatch when select by ComboBox

How many years of experience do you have?


  • Total voters
    4

GoAccess

New member
Local time
Today, 13:00
Joined
Mar 8, 2018
Messages
3
I have two tables between them relationship, One of these tables is a Main-form and the other is Continuous Sub-form, I put two Combo-box Wizard for find record from Main-form for Search, in query builder for these Combo-boxes appear two filed One of these filed FK and other filed with repeated data, and I make delete filed FK for unique value for other field, when go to form and select one of combo-box give me message "Type mismatch".
The second problem: from the same tables, Main-form and the other is Single Sub-form , i make Search by Text-box for sub-form, when Type Name give me "parameter value" and after press ok, the code go to First Record and
Not the specified record.
thanks for help me.
by this code:

-----------------------------------------------------------------------------------------------
Private Sub ComSearch_Click()
Dim KeyWord As String
KeyWord = Me.txtSearch
Me.Form.Filter = "Forms![AllNamesMain-1]![DetailsSub-1].Form![UserName] like '*" & KeyWord & "*'"
' DLookup("[UserName] ", "AllDetails", "UserNumber= '" & [UserName] & "' ")
Me.Form.FilterOn = True
Me.Form.FilterOn = False
End Sub
----------------------------------------------------------------------------
Private Sub txtSearch_AfterUpdate()
Call ComSearch_Click
End Sub
-----------------------------------------------------------------------------
 

Attachments

you dont filter on form objects, you filter on table Fields :
(what table field to filter, and the form value as criteria)

Me.Form.Filter = "[DataField] like '*" & me.txtKeyWord & "*'"
 
Thank you for reply.
I used this Code : Me.Form.Filter = "[DataField] like '*" & me.txtKeyWord & "*'"
but it not work, this is the second problem, i Search by text-box for "UserName" in Sub-Form from Main-Form, you can see the file in the link.
in the file : I make two forms (Main-form and the other is Continuous Sub-form) , (Main-form and the other is Single Sub-form)
 

Users who are viewing this thread

Back
Top Bottom