Results 1 to 9 of 9
  1. #1
    123seven is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2011
    Location
    Aurora, ON Canada
    Posts
    22

    "You can't go to the specified record".

    I have a form based on a query (single table) that opens and allows updates, additions and deletes. When I open it via a "Create an Order" command button, on a 'Customer' form using a macro with docmd.openform , I suddenly can't add a new record. This is the case whether I have the macro set to all records or specific records. As a a duck-tape fix I created a cmd button "add order" on frm orders, after it opens. On click it gives the error msg: " you can't go to the specified record". I've googled that but didn't find anything helped me with my sitch.

    The Form properties are:
    recordset: dynaset
    data entry: no


    allow additions: yes
    record locks: no lock
    fetch defaults: yes

    This db is used on two workstations with their own front ends and linked to tables in a BE db. We only use this system for 8 months of the year and are just back at it. I don't recall having this limitation in the past.

    Any help in explaining will be very appreciated.

    Cheers,
    Shannon

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I am not too good with Macros. Maybe you can post what the macro is comprised of with a screenshot or something.

    Another option would be to remove the embedded macro from the control button and add some VBA to the Click Event via the Code Builder.

    Something Like

    DoCmd.OpenForm "NameOfForm"

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Actually, very few of us use Macros, but posting the macro, as suggested, could help us help you. The parameters used in the command to open the Form are really important, because they can overcome the Form's inherent Properties, which is apparently what is happening here.

    DoCmd.OpenForm "FormName", , , , acFormAdd

    allows you to only add New Records.

    DoCmd.OpenForm "FormName", , , , acFormEdit

    allows you to add New Records and edit existing Records.

    Simply using DoCmd.OpenForm "FormName", which uses the default parameter, allows neither, and that's probably what is being used in the macro.

    Linq ;0)>

  4. #4
    123seven is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2011
    Location
    Aurora, ON Canada
    Posts
    22
    Hi Guys, thanks for your quick reply.

    I'm including code for both vba procedure and macro that I've tried on both front ends (one on each) with no good results.

    macro code is:
    Form name: frmOrdersAll
    View: Form
    Filter Name:
    Where Condition:
    Data Mode: Edit
    Window Mode: Normal

    VBA code is:
    Private Sub Command251_Click()
    DoCmd.OpenForm "frmOrdersAll", , , , acFormEdit

    End Sub

    Like I mentioned earlier, this same form opens from the Navigation form, ready to add records - no probs. It's the exact same parameters as the macro above.

    Thanks again,
    s

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    The macro seems to be doing nothing special and should not override the form's properties.

    The VBA code is problematic.
    should be

    DoCmd.OpenForm "frmOrdersAll", acNormal

    or

    DoCmd.OpenForm "frmOrdersAll"

    The other issue is the fact that you are using a Navigation Form/Control to open the other form. The act of opening a form from a Navigation Control can have an effect on the form's properties that it is opening, so long as the form that is opening opens within the navigation control. Consider the properties of the "button?" on the Navigation Control that is opening the other form.

  6. #6
    123seven is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2011
    Location
    Aurora, ON Canada
    Posts
    22
    Hi,
    thanks for the suggestion but no luck - that was the first way I created the vba procedure and just tried it again. The simple macro code on the Nav form cmd button (created from the wizard) is the exact same as the cmd button on my Customer Form (also created from the wizard). Can't think of any other way to open frmOrdersAll (to allow new records) other than heading back to the nav form and clicking frmOrdersAll, from there - 1 extra step...

    baffling !

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    So the Navigation form is not playing a role?

    If you want to upload your DB for analysis, remove private data first.

  8. #8
    123seven is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2011
    Location
    Aurora, ON Canada
    Posts
    22
    No the nav form has nothing to do with it - we're working a home show this weekend and it'll take some time to trim my client info out .. where would I be sending the db? To you directly?

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You can upload here to this thread by using the "Go Advanced" button and then " Manage Attachments". After you browse to the file, using the manager, you will need to click "Upload" to finalize your selection.

    EDIT: Don't forget to Compact and Repair THEN Zip Down your file before uploading.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 11-14-2012, 04:47 PM
  2. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM
  3. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  4. Replies: 16
    Last Post: 07-22-2011, 09:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums