×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

The command "SelectRecord" isn't available now HELP!

The command "SelectRecord" isn't available now HELP!

The command "SelectRecord" isn't available now HELP!

(OP)
Hello all,

I'm having a really irritating problem and I haven't been able to find a solution anywhere on the web.   I'm using Access 2003 and I have a form thats controls are bound to a simple table.    

I created a "duplicate record" button using the wizard, and then tweaked the code just a little bit in my attempts to fix the problem:

Private Sub btn_Duplicate_Click()
On Error GoTo Err_btn_Duplicate_Click
    
    If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord

    'Duplicate the record
    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append

    'Focus on the Scenario ID, it needs to be changed to make the record unique
    Forms![frm_LOPA_Master].[Scenario_ID].SetFocus

Exit_btn_Duplicate_Click:
    Exit Sub

Err_btn_Duplicate_Click:
    MsgBox Err.Description
    Resume Exit_btn_Duplicate_Click
    
End Sub


The code used to work correclty, but at some point I made some changes to the form properties, other control properties, or something else messed things up.   When I click the "Duplicate Record" button, Access creates a new record, but none of original records values are carried over.  No errors are trapped.

If I put a break in the code and then step through, an error is trapped at the line: "DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70".   The error message is:

The command "SelectRecord" isn't available now

I've tried using the following code as well, but I have the same problem:

   DoCmd.RunCommand acCmdSelectRecord
   DoCmd.RunCommand acCmdCopy
   DoCmd.RunCommand acCmdPasteAppend

Does anyone know what causes a command to be unavailable?   I've had this same problem while trying to "undo" because there was nothing to undo, but that was easily remedied by putting a "If Me.Dirty" condition in.   What about selecting a record though; what could prevent a record from being selected?

Regards,
Seth



 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

eBook - Manufacturing the Cars of Tomorrow
In this ebook, we'll explore how additive manufacturing is going to transform the way cars are made. This includes commentary from thought leaders such as Ford's CTO, Ken Washington, Customer case studies of ways 3D printing is being used today, and a variety of part examples where 3D printing is already impacting how automobiles are made. Download Now
White Paper - Smart Manufacturing for Semiconductor
New technologies and approaches present great opportunities for semiconductor manufacturers to achieve high levels of innovation, yield and improvement. This white paper explores some of these cutting-edge technologies and how they can be applied effectively in the semiconductor industry. Read about how Smart Manufacturing is transforming the semiconductor industry. Download Now
White Paper - Analysis and Simulation in Aircraft Structure Certification
Organizations using simulation and analysis tools effectively see the benefits in their ability to achieve certification faster and with drastically less total cost than those who do not maximize these tools. Read this White Paper to learn about how digital tools such as analysis and simulation help in aircraft structure certification. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close