DoCmd.GoToRecord then select based on a query (1 Viewer)

BennyLinton

Registered User.
Local time
Today, 12:18
Joined
Feb 21, 2014
Messages
263
I have a subform that displays one at a time the customer's address based upon the Customer in the parent form. Each customer may have several addresses with only one marked preferred. The addresses are in a separate table from the customer lis. Is there a way to have the customer's preferred address be the first one in the subform based on whether or not it is the preferred address? I'm thinking "DoCmd.GoToRecord" with a query result as one of the arguments may be a start (?) Thanks!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:18
Joined
May 7, 2009
Messages
19,247
do you have field [preferred address] on the table in the subform?
if you have one you can add sort order on the subform.
 

BennyLinton

Registered User.
Local time
Today, 12:18
Joined
Feb 21, 2014
Messages
263
Yes there is a checkbox on the subform for 'preferred'. Should I code the subform's 'on load' event? With a query?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:18
Joined
May 7, 2009
Messages
19,247
just bring your subform in design view.
on the form's Property Sheet->Data->

Order By: [preferred address field name]
Order By On Load: Yes
 

Users who are viewing this thread

Top Bottom