N
night_writer
I have a form thet displays a record with about 65 fields, 50 of which
are checkboxes for individual states. Based on the OnCurrent event, I
check the status of each checkbox and color code the label depending
on whether or not the box is checked. This subroutine is initiated by
the OnCurrent event, which I chose because it seems to be the only
event that fires as you flip through multiple records while paging
through the form.
I want to allow my users to duplicate this record, so I used the
wizard to create a button to duplicate it. The problem arises in that
apparently the OnCurrent event is being triggered even though the
window isn't "active." (I get 50 error messages that each say: "The
expression you entered requires the control to be in the active
window.") After I answer "OK" to each mesage, all of the data appears
in the form, and it even appears that the fields are colored properly
for the state of the check box, but this might be some kind of
artifact from the originating form.
Here is the code that the Wizard generated for me:
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste
Append
When I try to figure it out from the help file, it refers me to menus
from Access 95 for an interpretation of the numbers. I'm using 2003
but creating my data base in 2000 format. I have no idea what the code
is actually doing.
I think what I need is a way to create the record and then move to it,
so that the form is active before the OnCurrent event occurs (????).
Perhaps I could insert the new record with an SQL statement, or do
something with recordsets...I'm not very practiced with either of
those. I would appreciate any advice on a approch to this problem.
Alice
are checkboxes for individual states. Based on the OnCurrent event, I
check the status of each checkbox and color code the label depending
on whether or not the box is checked. This subroutine is initiated by
the OnCurrent event, which I chose because it seems to be the only
event that fires as you flip through multiple records while paging
through the form.
I want to allow my users to duplicate this record, so I used the
wizard to create a button to duplicate it. The problem arises in that
apparently the OnCurrent event is being triggered even though the
window isn't "active." (I get 50 error messages that each say: "The
expression you entered requires the control to be in the active
window.") After I answer "OK" to each mesage, all of the data appears
in the form, and it even appears that the fields are colored properly
for the state of the check box, but this might be some kind of
artifact from the originating form.
Here is the code that the Wizard generated for me:
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste
Append
When I try to figure it out from the help file, it refers me to menus
from Access 95 for an interpretation of the numbers. I'm using 2003
but creating my data base in 2000 format. I have no idea what the code
is actually doing.
I think what I need is a way to create the record and then move to it,
so that the form is active before the OnCurrent event occurs (????).
Perhaps I could insert the new record with an SQL statement, or do
something with recordsets...I'm not very practiced with either of
those. I would appreciate any advice on a approch to this problem.
Alice