I'm having real trouble with this form… I have a form with a sub-form called "NewReservation" the form opens with patient information on the main form. The sub-form opens blank ready for data, this works fine. The problem comes in, with a command button on the main form the button is used to open another form called "OrdersRes"; this form is another form with a sub-form. I want the main part of the "Orders" form to open with data from the both the "Reservation and ReservationSub". I can get the "Orders" form to open with the patient information by using the code.
Dim MyOrders As String
MyOrders = "OrdersRes"
DoCmd.Save acForm, "NewReservation"
DoCmd.OpenForm MyOrders, , , "SocialSecurityNumber= '" & Forms!NewReservation !SocialSecurityNumber & "'"
When I filter with this the "OrdersRes" open with the correct patient the problem is if the patient has multiple Reservations the filter comes up with all the records for the patient. This is still working correctly but I'm trying to filter it down to the reservation I'm working on. I have a field on the "NewReservationSub" named "ReservationNumber" this is an auto number field used to make the record unique, my trouble is trying to pass this value to the Where clause in the code. Please help this is making me crazy, Thank you for any help.
Dim MyOrders As String
MyOrders = "OrdersRes"
DoCmd.Save acForm, "NewReservation"
DoCmd.OpenForm MyOrders, , , "SocialSecurityNumber= '" & Forms!NewReservation !SocialSecurityNumber & "'"
When I filter with this the "OrdersRes" open with the correct patient the problem is if the patient has multiple Reservations the filter comes up with all the records for the patient. This is still working correctly but I'm trying to filter it down to the reservation I'm working on. I have a field on the "NewReservationSub" named "ReservationNumber" this is an auto number field used to make the record unique, my trouble is trying to pass this value to the Where clause in the code. Please help this is making me crazy, Thank you for any help.