An expression you entered is the wrong data type for one of the arguments
Posted on 2006-07-17
I have created a form called frmContactCategoryFilter which lists ContactCategory in an unbound box
When the user selects a ContactCategory and clicks OK, frmContact is opened showing only records which have the same ContactCategoryID as the selection
The 'OK' button has the following code
Dim DocName As String
Dim LinkCriteria As String
DocName = "frmContact"
LinkCriteria = "[ContactCategoryID] = Forms![frmContactCategoryFilter]![lstContactCategory]"
DoCmd.OpenForm DocName, , , LinkCriteria
And it works.
When frmContact opens, I would like frmContactCategoryFilter to close.
However, whenever I try to add a DoCmd.Close , frmContact opens showing the correct records,
the message "An expression you entered is the wrong data type for one of the arguments" is displayed
and frmContactCategoryFilter remains open.
What should I do?