Good morning all,
Sorry to bother you again, yesterday I asked for help with sequential numbering using DMAX, it turned out that I had set the field type to text and DMAX stopped updating the sequence when it got to 10. Following the kind advice given, I reset the field type to number and applied the required formatting to the cell to display the required leading 000s. Then with a tweak of the code offered by @bob fitz, all worked well.
Unfortunately, when I opened the project this morning, I found that changing the field type of Report_ID to number has stopped another part of my project from working. I have a single combo box: cboChooseReport, which returns the values of the Report_ID from qrySelectReport , as there could be multiple revisions of a report, the qry is set to return unique results.
The output of this qry is then used to feed 2 text boxes on the form: txtSelectRev and txtSelectID. I use DMax to identify the highest value of Report_Version in txtSelectRev and the ID of this record in txtSelectID, txtSelectRev is used for reference only and the value of txtSelectID is used to populate a report Based on the record selected.
The control source for txtSelectRev is:
And
txtSelectID:
As I said, this was working before, but, having changed Report_ID to a number field returns #error for rev and #Type! for ID. If I revert to Field type for Report_ID as text, all is as it should be, but this stops other parts of the project working
I have tried to change syntax, but I am out of my depth.
Could anyone help please?
Sorry to bother you again, yesterday I asked for help with sequential numbering using DMAX, it turned out that I had set the field type to text and DMAX stopped updating the sequence when it got to 10. Following the kind advice given, I reset the field type to number and applied the required formatting to the cell to display the required leading 000s. Then with a tweak of the code offered by @bob fitz, all worked well.
Unfortunately, when I opened the project this morning, I found that changing the field type of Report_ID to number has stopped another part of my project from working. I have a single combo box: cboChooseReport, which returns the values of the Report_ID from qrySelectReport , as there could be multiple revisions of a report, the qry is set to return unique results.
The output of this qry is then used to feed 2 text boxes on the form: txtSelectRev and txtSelectID. I use DMax to identify the highest value of Report_Version in txtSelectRev and the ID of this record in txtSelectID, txtSelectRev is used for reference only and the value of txtSelectID is used to populate a report Based on the record selected.
The control source for txtSelectRev is:
Code:
=DMax("[Report_Version]","tbl_Report","[Report_ID] = '" & [cboChooseReport] & "'")
And
txtSelectID:
Code:
=DLookUp("[ID]","tbl_Report","Report_Version = " & [txtSelectRev] & " AND Report_ID = '" & [cboChooseReport] & "'")
As I said, this was working before, but, having changed Report_ID to a number field returns #error for rev and #Type! for ID. If I revert to Field type for Report_ID as text, all is as it should be, but this stops other parts of the project working
I have tried to change syntax, but I am out of my depth.
Could anyone help please?
Attachments
Last edited: