Hello-
I am trying to set the default value of a forms text box to the max value in a table. I can’t seem to get the code right
The Dmax finds the max value in the table and seems to be ignoring the criteria.
Thanks for any help.
I am trying to set the default value of a forms text box to the max value in a table. I can’t seem to get the code right
Code:
Me!txtReceiptNumber.DefaultValue = DMax("[ReceiptSlipNumber]", "M_ReceiptSlip"), "[ReceiptSlipSites_IDs] = cboSites_IDs")
Where
txtReceiptNumber is text box on form F_ReceiptSlip
cboSites_IDs is combo box on form F_RceiptSlip
ReceiptSlipSites_IDs is field in table M_ReceiptSlip
The Dmax finds the max value in the table and seems to be ignoring the criteria.
Thanks for any help.