Good Morning, everybody. I'm new to the site, and wanted to first introduce myself, and then ask for help on an issue that's been getting me stuck for a few days.
I'm having an issue looping a macro, given a condition. I have a form, frmMain, with a table as a recordsource (tbl_PDC_Parts) with a hidden text box (txtCount) on it that calculates the number of Null values in a table column (Rec_Location from tbl_PDC_Parts). The macro updates this column with data, and I need it to loop until all the values in the column are filled with data.
I then created a macro that runs my original macro, with the repeat expression: [Forms]![frmMain]![txtCount]>0
In VBA, I have the following, with the goal of updating the txtCount text box each time the macro runs, in order to make my repeat expression work:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.Updated = True
End Sub
This seems to work, as in it assigns all the values I need to the field, but it keeps looping infinitely, and it causes access to stall and crash eventually. :banghead: If I change the ending of the repeat expression to:
[Forms]![frmMain]![txtCount]=0, then nothing happens at all when I click the button on my form.
My goal is just to have this macro run until all values in column Rec_Location, from table tbl_PDC_Parts, are entered, and then stop.
Any help would be greatly appreciated!
I'm having an issue looping a macro, given a condition. I have a form, frmMain, with a table as a recordsource (tbl_PDC_Parts) with a hidden text box (txtCount) on it that calculates the number of Null values in a table column (Rec_Location from tbl_PDC_Parts). The macro updates this column with data, and I need it to loop until all the values in the column are filled with data.
I then created a macro that runs my original macro, with the repeat expression: [Forms]![frmMain]![txtCount]>0
In VBA, I have the following, with the goal of updating the txtCount text box each time the macro runs, in order to make my repeat expression work:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.Updated = True
End Sub
This seems to work, as in it assigns all the values I need to the field, but it keeps looping infinitely, and it causes access to stall and crash eventually. :banghead: If I change the ending of the repeat expression to:
[Forms]![frmMain]![txtCount]=0, then nothing happens at all when I click the button on my form.

My goal is just to have this macro run until all values in column Rec_Location, from table tbl_PDC_Parts, are entered, and then stop.
Any help would be greatly appreciated!