Forum Discussion
Docmd.Openform (like)
- Dec 29, 2021
Tony2021 It depends, in part, on the datatype of this field in the table. It is, I understand, a double ( number which includes decimals to a specified precision).
That means Like as an operator is not appropriate. Like is used with Text, or String, values.
You can include any number with 7 as the whole number and ANY decimal amount by using a type conversion function to coerce these values:
DoCmd.OpenForm "frmPmtProposalALL", , , "Clng(DDNo) =" & Me.txtDDNo
should do it. Please try that and report back if it works as required.
Tony2021 It depends, in part, on the datatype of this field in the table. It is, I understand, a double ( number which includes decimals to a specified precision).
That means Like as an operator is not appropriate. Like is used with Text, or String, values.
You can include any number with 7 as the whole number and ANY decimal amount by using a type conversion function to coerce these values:
DoCmd.OpenForm "frmPmtProposalALL", , , "Clng(DDNo) =" & Me.txtDDNo
should do it. Please try that and report back if it works as required.
I noticed that if for example I am on
txtDDNo = 7 then it will include 7 and 7.1
However
txtDDNo = 7.1 then the form opens with null. Meaning the recordset is neither 7 or 7.1. Form opens null.
do you have a suggestion? thank you