I have poured hours into attempting to resolve this issue, but have experienced no luck! All suggestons I have been able to find have been fruitless, so I appeal here...to you.
My wife runs a consignment business and uses Access to track sales, profit shares, etc. It is her cash register and her checkbook. We have a form used forchekout that has several fields...one is autogenerated Order Number (OrderID), and another is Customer Name (Name). Both are held in the same table...OrderID is the primary key. My wife wants a next and previous record button to navigate by Order ID. That seemed simple & out of the box doCmd.gotorecord,,acnext.
When I invoke the VB by clicking the arrow, the form transitions to the next record, but does so by alphabetized "Name." We want it to go to the next record based on the numerical "OrderID." I have tried a handful of things, including SetFocus, and have dumped hours into manipulating gotorecord syntax with no joy. Worthy to mention--when I Find/Replace (CTRL-F), the default Look In is Name. Seems related, but perhaps not.
I'm at my wit's end for such an outwardly simple task. Any good suggestions?
This must be because the data set of your form is sorted on the "Name" field and not on the "OrderID" field. Check:
- Is OrderID actually defined as the primary key of the table?
- What's the RecordSource property of the form?
- What are the OrderBy and OrderByOn properties of the form?