R
ryguy7272
I have a Form that is bound to a Query and the source of the Query is a
Table. This Table, named ‘Radon’ has patient health information and a unique
ID for each patient. This ‘Radon Table is linked to another Table, named
‘PatientTable’, via the unique ID. The PatientTable has all information
pertaining to each patient. So far so good. I read here how to update a
Query based on a Form:
http://allenbrowne.com/ser-61.html
At first the records were not updatable and I realized it was because my
Joins were not indexed correctly. I applied a PK, and everything seemed to
work. Emphasis on SEEMED… The query is not updatable, and the data in the
‘Radon’ Table is updated too, so this is great, but only the first record in
the Table is updated!! On my Form, I have the ID, the patient’s FIrstName
and LastName. I enter the ID, and the FirstName and LastName are updated via
a Dlookup. This seems to be the way to go. The only problem is that if I
enter Patient 2323, I actually end up undating the data for patient 2222,
because that is the first record in the ‘Radon’ Table.
I have a Command Button that users can click, and this code runs:
Private Sub UpdatePatient_Click()
MsgBox "Thanks!! " & Me!FirstName & " " & Me!LastName & " has been
successfully updated!!"
End Sub
I think the Query updates without the code running, but when the code fires
a MessageBox pops up notifying the user that the information is indeed
updated. Is this the right way to of this kind of thing? Also, how do I get
the correct patient records updated, according to the ID number? If I move
to the next record using the control at the bottom of the Form, the correct
records are updated, but this seems to run independent of my ID, and my
FirstName and LastName, which are linked to the ID.
Two separate questions. I’ve hit a wall and I can’t seem to figure this out…
Thanks,
Ryan---
Table. This Table, named ‘Radon’ has patient health information and a unique
ID for each patient. This ‘Radon Table is linked to another Table, named
‘PatientTable’, via the unique ID. The PatientTable has all information
pertaining to each patient. So far so good. I read here how to update a
Query based on a Form:
http://allenbrowne.com/ser-61.html
At first the records were not updatable and I realized it was because my
Joins were not indexed correctly. I applied a PK, and everything seemed to
work. Emphasis on SEEMED… The query is not updatable, and the data in the
‘Radon’ Table is updated too, so this is great, but only the first record in
the Table is updated!! On my Form, I have the ID, the patient’s FIrstName
and LastName. I enter the ID, and the FirstName and LastName are updated via
a Dlookup. This seems to be the way to go. The only problem is that if I
enter Patient 2323, I actually end up undating the data for patient 2222,
because that is the first record in the ‘Radon’ Table.
I have a Command Button that users can click, and this code runs:
Private Sub UpdatePatient_Click()
MsgBox "Thanks!! " & Me!FirstName & " " & Me!LastName & " has been
successfully updated!!"
End Sub
I think the Query updates without the code running, but when the code fires
a MessageBox pops up notifying the user that the information is indeed
updated. Is this the right way to of this kind of thing? Also, how do I get
the correct patient records updated, according to the ID number? If I move
to the next record using the control at the bottom of the Form, the correct
records are updated, but this seems to run independent of my ID, and my
FirstName and LastName, which are linked to the ID.
Two separate questions. I’ve hit a wall and I can’t seem to figure this out…
Thanks,
Ryan---