I have a small Doctor's office DataBase written on access 97 and I have two problems that are keeping me from finishing. The first is that I have form's opening from a form that I call "open" this is built from an unbound dropdown box that gets it's data from a query of patients names and uses a module on the after-update that uses the SSN as the criteria for the filter. This works fine but I run into a problem with forms with sub-forms. These forms should open with the sub-form opening ready for data-entry. And they will open correctly if I open them without the use of the "open" form but if I use the "open" form if the patient has any data in the underlying table the form opens with the sub-form filled with that data. The Sub for the "open" form is.
Private Sub SelectPatient_AfterUpdate()
Dim Criteria As String
If Not IsNull(Me![SelectPatient]) Then
Criteria = "[SocialSecurityNumber] = '" & Me![SelectPatient].Column(1) & "'"
DoCmd.OpenForm "Chart"
Forms!Chart.Filter = Criteria
Forms!Chart.FilterOn = True
End If
End Sub
Any help is greatly appreciated. My other problem is I have a form called "Reservation" this is a form with a sub-form this is used when a patient need a procedure done at the hospital this form opens with the patient demographics filled in, and the staff fills in the hospital's info. This works well the problem comes in with a command button on the "Reservation" form for "PreTestOrders" this is a form that opens from the "Reservation" form I would like this form to open using the information from the Reservation they are working on. As it is now the "PreTestOrders" opens if there are any past reservations for the patient these come up first. I'm sure there is a where condition needed but not sure what to do with it, in my tables I have fields for reservation and orders numbers hoping the answer is in these somewhere but I can't get it. Once again any help is appreciated and I really need help THANKS.
Private Sub SelectPatient_AfterUpdate()
Dim Criteria As String
If Not IsNull(Me![SelectPatient]) Then
Criteria = "[SocialSecurityNumber] = '" & Me![SelectPatient].Column(1) & "'"
DoCmd.OpenForm "Chart"
Forms!Chart.Filter = Criteria
Forms!Chart.FilterOn = True
End If
End Sub
Any help is greatly appreciated. My other problem is I have a form called "Reservation" this is a form with a sub-form this is used when a patient need a procedure done at the hospital this form opens with the patient demographics filled in, and the staff fills in the hospital's info. This works well the problem comes in with a command button on the "Reservation" form for "PreTestOrders" this is a form that opens from the "Reservation" form I would like this form to open using the information from the Reservation they are working on. As it is now the "PreTestOrders" opens if there are any past reservations for the patient these come up first. I'm sure there is a where condition needed but not sure what to do with it, in my tables I have fields for reservation and orders numbers hoping the answer is in these somewhere but I can't get it. Once again any help is appreciated and I really need help THANKS.