L
Lena
I have a DB that we use for equipment inventory and surplusing. When a piece
of equipment has been surplused it must be moved to a table called
tblSurplused. The information remains in the "active" portion of the DB as
the user name and location may not change, this allows for adding only the
new equipment information without asking the data entry operators to rekey
all the user information plus the equipment info. Here's the setup. I have
a main and a subform. The main has the user location/address, the sub has
user name, equipment name, serial number, etc. I have the main and the sub
linked by the location ID, so far so good. The subform is in datasheet view
to make for easier reading and column arranging for the ops. I placed a
check box on the screen called SURPLUSED. When this box is checked I asked
for the following to take place:
Private Sub SURPLUSED_AfterUpdate()
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.OpenTable "Surplus tbl", acNormal
DoCmd.GoToRecord , , acNewRec
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdPaste
DoCmd.Close
Me.SURPLUSED = "False"
End Sub
The Me.SURPLUSED = "False" unchecks the SURPLUSED BOX in the active subform
and prepares it for the next time a user has updated equipment assigned. The
code works perfectly, except the data from the selected record does not copy
over to the table.
I have tried to copy to the subform, no luck. I then decided to go directly
to the table and paste the data. Everything works, except no data has been
pasted in the table. Where am I going wrong? I know it's something that's
staring me in the face and I'm just missing it. Would appreciate any
help/input.
of equipment has been surplused it must be moved to a table called
tblSurplused. The information remains in the "active" portion of the DB as
the user name and location may not change, this allows for adding only the
new equipment information without asking the data entry operators to rekey
all the user information plus the equipment info. Here's the setup. I have
a main and a subform. The main has the user location/address, the sub has
user name, equipment name, serial number, etc. I have the main and the sub
linked by the location ID, so far so good. The subform is in datasheet view
to make for easier reading and column arranging for the ops. I placed a
check box on the screen called SURPLUSED. When this box is checked I asked
for the following to take place:
Private Sub SURPLUSED_AfterUpdate()
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.OpenTable "Surplus tbl", acNormal
DoCmd.GoToRecord , , acNewRec
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdPaste
DoCmd.Close
Me.SURPLUSED = "False"
End Sub
The Me.SURPLUSED = "False" unchecks the SURPLUSED BOX in the active subform
and prepares it for the next time a user has updated equipment assigned. The
code works perfectly, except the data from the selected record does not copy
over to the table.
I have tried to copy to the subform, no luck. I then decided to go directly
to the table and paste the data. Everything works, except no data has been
pasted in the table. Where am I going wrong? I know it's something that's
staring me in the face and I'm just missing it. Would appreciate any
help/input.