Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Other Records from Form

Status
Not open for further replies.

hubs99

Programmer
Jul 9, 2004
17
US
I do not know if this is possible but I thought I would ask if anyone had any idea how to do it.

We are tracking weight and heights of patients and I was hoping to show the previous entries' height and weight in a locked field. Is there anyway to show other record's information? OR and possibly better I have the most recent height in a separate query can I show that information on the same form?
 
Hi
If you are tracking weights, would a subform with all previous weights and heights be useful? Otherwise Dlookup may suit:
DLookup Function Examples
faq705-4978
Or have I missed your point?
 

Use a form with Default View set to continuous forms?
 
Hi

Follow this example and you'll get what you want...

Create a table called Table1.

Field 1 HeightID AutoNumber
Field 2 Height Number

Save the table

Right click table and choose save as form

Open the form and go to design view

right click form and click Form Header/Footer

Copy and paste the height field into the form footer

Alter the controlsource from "Height" to "Last([Height])"

That's it... save the changes...

When you add a new record it will show you the previous height entered in the new field just created. The syntax you required was the "Last([field])"

Regards

BuilderSpec
 
You can use a listbox with Rowsource using that query.

________________________________________________________________________
Zameer Abdulla
Visit Me
Children are poor men's riches.
 
What about for check boxes? IS there a way to use a query for them as well?

For the Last(Ht) will that make sure that the last height is from the same patient?

Thanks for all the suggestions. Any others would be highly appreciated.


Hubs
 
Hi

If you want the last height for the same patient then you need to filter the query. For example,

'select Last([Height]) from Patients where PatientID=???'

better yet if there is a date field on the table to record when the height was taken you would say...

'select Last([Height]) from Patients where PatientID=' & SomePatiendID & ' order by DateHeightRecorded'

what happens here is SQL obtains a list of values, sorts them in date order first to last then gives you the last entry.. a more efficient alternative would be ...

'select First([Height]) from Patients where PatientID=' & SomePatientID & ' order by DateHeightRecorded DESC'

here we order the values by Date order but from latest to earliest and then pick off the first date in the list which is the one you want....

hope this helps

BuilderSpec
 
Where would I be using this select statement? I know I could use it as a listbox but what about checkboxes? Would I use default value? Or is there another way?


Thanks to everyone who has helped me.
Hubbard
 
Sorry for the late response, I actually got to go away on vacation.


The check box information is for drugs and symptoms of patients. This past information is more a convinience for the nurses inputing the data so they can see what meds the patient was on last time. Everytime a patient comes we have to log the patient meds and have to maintain a list of meds they have been and is why I cant just simeple hve the nurses update the same table of info.
 
How are ya hubs99 . . . . .

You can have these fields locked unless the user is on a new record (allows editing).
Code:
[blue]   Dim flg As Boolean
   
   If Me.NewRecord Then flg = True
   Me!Textbox1.Locked = flg
   Me!Textbox2.Locked = flg[/blue]
Your thoughts?

Calvin.gif
See Ya! . . . . . .
 
But How can I show check box information from previous visits?
 
hubs99 said:
[blue]But How can I show check box information from previous visits?[/blue]
In agreement with [blue]Remou[/blue], [blue]subforms linked to a Patient mainform[/blue] is your most immediate answer. One for Height & Weight (including a date field) tracking and another for these checkboxes. Realize since these subforms will have many records your talking two additional tables, and you should have them from what you've already stated.

Also its tough for us without knowing whats under the hood. That is [blue]table structure & relationships[/blue] for the most part, along with any form structure. So . . . we can be more discrete/direct if you open the hood a little.

Calvin.gif
See Ya! . . . . . .
 
Can you give an example of what the checkbox text might say ... is it ? Has patient been prescribed ....? or something ?

BuilderSpec

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top