Forum Discussion
Tony2021
Dec 29, 2021Steel Contributor
Docmd.Openform (like)
Hello, I have a form and a click event on a field that opens another form based on the Me.DDNo (double format). I need to modify it to open frmPmtProposalALL for taking into account decimals. L...
- 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.
arnel_gp
Dec 30, 2021Steel Contributor
you may also try:
DoCmd.OpenForm "frmPmtProposalALL", , , "DDNo >= " & Me.txtDDNo & " And DDNo < " & CLng(Me.txtDDNo) + 1
DoCmd.OpenForm "frmPmtProposalALL", , , "DDNo >= " & Me.txtDDNo & " And DDNo < " & CLng(Me.txtDDNo) + 1
Tony2021
Dec 30, 2021Steel Contributor
Hi Arnel,
thank you for the response. Do you have another idea? It didnt filter for any records. The form that opened on the Click event opened but there were no records. I re-checked the names and they are accurate. Format for DDNo is number, double.
thank you for the help
thank you for the response. Do you have another idea? It didnt filter for any records. The form that opened on the Click event opened but there were no records. I re-checked the names and they are accurate. Format for DDNo is number, double.
thank you for the help
- Tony2021Dec 30, 2021Steel ContributorArnel, sorry I had a refresh issue. It works great! thank you to you both. Happy New Year!