D
Deleted member 147267
Guest
My interpretation:
open a recordset from a query
Set rsQuery = dbs.OpenRecordset("qryStaffMonthlyPayroll", dbOpenDynaset)
Do While Not rsQuery.EOF < until no more records, set these fields to these form control values...
(Field = me.control)
dtStaffDoB = Me.StaffDateofBirth
sngBasicSalary = Nz(Me.BasicSalary, 0)
or are they just variables for which we don't see any declaration??
then set a bunch of form fields to what look like values returned from functions
e.g. Me.txtTotalAllowances = CalculateAllowances
interspersed with setting what look like variables to expressions and form controls to variables
On top of that, each time the code loops, the variables will change values but the variables a never used, and even if they were, it would be outside of the loop. Perhaps the called functions use those variables and those variables are public, which would explain why they're not shown as being declared.
You are correct that form controls are being set to recordset (?) values, but for the ones I listed at the top of this post, at first I thought it's the other way around. Now I think they're variavbles. So maybe what I thought was an attempt to edit a recordset field is something else all together.
The code is lacking something - either notation to remove the confusion or a complete re-write. It might be prudent to point out at this time that the confusion we have will be experienced by the writer in the future; say six months from now when it needs to be reviewed or tweaked. Sooner or later, the writer will be just as stumped because of the lack of documentation.
open a recordset from a query
Set rsQuery = dbs.OpenRecordset("qryStaffMonthlyPayroll", dbOpenDynaset)
Do While Not rsQuery.EOF < until no more records, set these fields to these form control values...
(Field = me.control)
dtStaffDoB = Me.StaffDateofBirth
sngBasicSalary = Nz(Me.BasicSalary, 0)
or are they just variables for which we don't see any declaration??
then set a bunch of form fields to what look like values returned from functions
e.g. Me.txtTotalAllowances = CalculateAllowances
interspersed with setting what look like variables to expressions and form controls to variables
On top of that, each time the code loops, the variables will change values but the variables a never used, and even if they were, it would be outside of the loop. Perhaps the called functions use those variables and those variables are public, which would explain why they're not shown as being declared.
You are correct that form controls are being set to recordset (?) values, but for the ones I listed at the top of this post, at first I thought it's the other way around. Now I think they're variavbles. So maybe what I thought was an attempt to edit a recordset field is something else all together.
The code is lacking something - either notation to remove the confusion or a complete re-write. It might be prudent to point out at this time that the confusion we have will be experienced by the writer in the future; say six months from now when it needs to be reviewed or tweaked. Sooner or later, the writer will be just as stumped because of the lack of documentation.