Run-time error '2046'

M

MiG

When I use this code DoCmd.RunCommand acCmdCopy in the -On Get Focus- event
of a combo box record (possible in the case of cmb?), it generates this
error!! Any thoughts on why this occur? Thanks, MiG
 
M

Michael H

Hi.

Are you trying to copy the current record to a new record? I'm not sure why
you would want to do this in the Got Focus event, but:

To copy a record (much like copying a file, or some text) you have to first
select the record, then copy, then paste. Error 2046 is "The command or
action 'Copy' isn't available now.", and the probable reason why the command
isn't available is that there is no record selected. Try substuting your one
line with these three:
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPasteAppend

-Michael
 
Top