RE: DoCmd or RunCommand

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thank you so much. I found out exactly that after the fact. There was a
field missing. I made an exact copy of the table fields in the subform and
the record went over. Thanks for your response.

"NetworkTrade" wrote:

if copy/paste of a single record does not work then one possibility is that
the layout of the 2 tables are not exactly equal. Another possibility is
that you are including the autonumber field which won't work....be sure to
leave that out of the copy/paste
--
NTC


"Lena" wrote:

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.

.



Relevant Pages

  • RE: DoCmd or RunCommand
    ... if copy/paste of a single record does not work then one possibility is that ... new equipment information without asking the data entry operators to rekey ... The subform is in datasheet view ... DoCmd.OpenTable "Surplus tbl", acNormal ...
    (microsoft.public.access.forms)
  • Re: Synchronize 2 combo boxes
    ... I am sorry for not reading properly, Yes my table is called Equipment ... correct subform control name. ... but it opens adobe along with a web page that crashes the internet. ...
    (microsoft.public.access.forms)
  • Re: Save record on subform? PLEASE help!
    ... Once in the subform, the user is supposed to be ... > able to add equipment data that is attached to that customer. ... > already existed, blah, blah, blah...". ...
    (microsoft.public.access.modulesdaovba)
  • Re: Save record on subform? PLEASE help!
    ... attempt by Access to add the record to the database. ... >> that brings up a subform. ... >> able to add equipment data that is attached to that customer. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Save record on subform? PLEASE help!
    ... use error event to catch such kind of error and process then there. ... >>> that brings up a subform. ... >>> able to add equipment data that is attached to that customer. ...
    (microsoft.public.access.modulesdaovba)