Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would have to see your table to be sure but the issue might be GoToRecord offsets the number specified from the beginning of the recordset. This means that if you have an address id of 51 it will take you to record 51 in theory. </p> <p>The problem with using this method is that if you delete any <code>AddressID</code> then 51 will not be the record you want because it is taking you to the 51st record regardless of <code>AddressID</code>.</p> <p>For Example I add 100 Records to Addresses with IDs 1-100 then I delete the first 99 of them and I am left with <code>AddressID</code> 100 if I use this command I will receive the standard "You can't go to the specified record." becuase I am telling access to go to a record that does not exist. </p> <p>Please check you table to make sure that all the <code>AddressID</code> fields are exactly in order and let me know. Generally I would not recommend this as a method of navigation. </p> <p>Is <code>AddressID</code> a auto-increment number in access? Are you guaranteeing that an address will never be deleted? </p> <p>Try this</p> <pre><code>'expression.SearchForRecord(ObjectType, ObjectName, Record, WhereCondition) Docmd.SearchForRecord acForm,"NavigationSubform",,"AddressID=" &amp; addr_id </code></pre> <p>This will actually search the record set for the WHERE condition specified and Go To that record. Note this goes to the First record it finds which should not be a problem since you are using an ID.</p> <p>Using Filter</p> <pre><code>With Me.NavigationSubForm.Form .Filter = "AddressID=" &amp; addr_id .FilterOn = True End With </code></pre> <p>This will only show the results with that Address ID in the subform </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload