Command Button to advance to next record not next line

Nyanko

Registered User.
Local time
Today, 23:17
Joined
Apr 21, 2005
Messages
57
Hi,
I've been working on and off on Access for years, yet seem to completely forget all I've learned in the interim !

I'm working on an Invoice tracker where the user can save different lines of information associated to one invoice. So one InvoiceID may have several rows of information for different cost centres etc...

I have set up my table to have unique rowID for each line but there will be duplicate InvoiceIDs

ROWID INVOICEID VALUE
1 INV001 £10
2 INV001 £20
3 INV002 £30

I would like a "Next" button on an input form to advance through the INVOICEIDs rather than the ROWIDs which is what the command button option seems to do as standard.

Any advice is welcome :)
 
I have a main/sub form set up and linked with

Link Master Fields : InvoiceID
Link Child Fields : InvoiceID

The forms link beautifully and behave just as I would expect. I have added a command button to the main part of the form using the Design/Button wizard and chose Record Navigation>Go To Next Record.

When I test it out I have to press it three times to get it to move to the next InvoiceID as there are three Rows associated with it. I just want a button to advance from one InvoiceID to the next, regardless of how many RowIDs are associated with them

Any guidance is appreciated :)
 
docmd.GoToRecord acDataForm,"yourMainFormName",acNext
 
..
When I test it out I have to press it three times to get it to move to the next InvoiceID as there are three Rows associated with it. I just want a button to advance from one InvoiceID to the next, regardless of how many RowIDs are associated with them

Any guidance is appreciated :)
Move the cursor/focus to the mainform!
 

Users who are viewing this thread

Back
Top Bottom