C
Christopher Glaeser
I implemented command buttons like "Open" and "All" on frmWorkOrders so
users could view the open or all workorders. This is done in VBA code by
setting the form recordsource to the queries qryWorkOrdersOpen and
qryWorkOrdersAll. This is my first Access project, and I did not realize
these assignments would persist for the next time the form was open. There
are command buttons on other forms that open frmWorkOrders to a specific
workorder, but frmWorkOrders will open blank if that specific workorder is
closed and the last recordsource was qryWorkOrdersOpen.
Now that I better understand this persistence issue, I need to take a step
back and review my design. Is it good practice to change a form's
recordsource to different queries? If so, should I always set the
recordsource to a known state when opening a form? Or, should I set the
recordsource to one and only one state (all), and use some other method to
filter the records?
Best,
Christopher
users could view the open or all workorders. This is done in VBA code by
setting the form recordsource to the queries qryWorkOrdersOpen and
qryWorkOrdersAll. This is my first Access project, and I did not realize
these assignments would persist for the next time the form was open. There
are command buttons on other forms that open frmWorkOrders to a specific
workorder, but frmWorkOrders will open blank if that specific workorder is
closed and the last recordsource was qryWorkOrdersOpen.
Now that I better understand this persistence issue, I need to take a step
back and review my design. Is it good practice to change a form's
recordsource to different queries? If so, should I always set the
recordsource to a known state when opening a form? Or, should I set the
recordsource to one and only one state (all), and use some other method to
filter the records?
Best,
Christopher