Custom Record Navigation Buttons (1 Viewer)

Fowz

Registered User.
Local time
Today, 19:35
Joined
Jan 25, 2014
Messages
14
Hi all,

To briefly explain my database; it is a bespoke referral management system within a hospital. Each record on the database contains patient demographic information, as well as information on their referral (i.e. date of referral, date of assessment, date of commencing treatment, discharge date etc.) Therefore, the same patient will appear multiple times in the database, with each separate record corresponding to a unique referral pathway.

The database forms are split to show patient information at the top, with referral information shown in a subform. I am trying to add navigation buttons to the subform that will allow the user to scroll through the referrals corresponding to the patient currently displayed on the main
form.

Each patient has a uniquely identifiable number associated with them, and so it seems straightforward enough in my mind to have a button that will search for the record in the database where the patient's number matches the patient number of the current record, and where the referral date is minimum (for "First Referral"), maximum but less than current (for "Previous Referral"), minimum but greater than current (for "Next Referral"), and maximum (for "Last Referral").

I can't seem to stumble upon the code for this, however. Any help?
 

wader

Registered User.
Local time
Today, 11:35
Joined
Aug 7, 2013
Messages
25
Just to clarify...do you have your patient info separated from your referral info with some sort of foreign key association? or is it all in the same table...i.e. you have duplicate patient records?
 

Fowz

Registered User.
Local time
Today, 19:35
Joined
Jan 25, 2014
Messages
14
Everything is in the one table. Patient info amounted to about a dozen fields and so I didn't feel it was worth the bother of separating over multiple tables.
 

GinaWhipp

AWF VIP
Local time
Today, 14:35
Joined
Jun 21, 2011
Messages
5,899
Because you have the information in one table you'll need two queries, one for the Main form and one for the Subform. Is that the set-up you have now?
 

Fowz

Registered User.
Local time
Today, 19:35
Joined
Jan 25, 2014
Messages
14
I'm not sure that I quite follow. The forms I have made are based solely on the table. Would I need to create queries from the table and build the forms from them?

At the moment, the user can scroll through all records using the forms and simply searches by patient information to find the record that they are looking for. A bit of confusion (for some users more than others) arises when a patient has multiple records, and so I was hoping to make it a more user-friendly experience by creating these buttons that could scroll through a patient's referrals in chronological order.

I was hoping it would be as simple as finding the correct VB code for a form navigation button.
 

GinaWhipp

AWF VIP
Local time
Today, 14:35
Joined
Jun 21, 2011
Messages
5,899
You would have to redo those Forms in order to set up a one-to-many Form/Subform. Then when you look up the Patient in the Main Form all the Referral information will show up in the Subform. Isn't that what you want?
 

Users who are viewing this thread

Top Bottom