Hello! I am hoping this is a silly coding error, and it likely is. Forgive me if I do not give enough detail, I am new to this.
I am building a tracking database that will be used to schedule appointments for various people. Currently, I am working with 2 forms and 2 subforms. The first form (frm_Client List) is a client overview form which shows all clients in a split form manner and seems to be working perfectly. The second (frm_Client Info) shows further details on a specific client by their unique "DB ID". On the client info form, I have 2 subforms both linking to queries on a session tracking table. The session tracking is linked up via the clients DB ID and then queried by date (I am working on giving a time guideline too) to split into upcoming sessions and past sessions (which then appear as subforms on frm_Client Info). From there, I am using a recordset code on the Upcoming session subform to select the next session and show that info (time and date) on an auto-updated banner for the database. I have that part working with the following code in the form load event of frm_Client Info (if there is an easier way to do this, which I am sure there is, PLEASE let me know!!!):
Code:
Private Sub Form_Load()
Dim Care_Coach_Database As DAO.Database
Dim rcdNextSession As DAO.Recordset
Set Care_Coach_Database = CurrentDb
Set rcdNextSession = Care_Coach_Database.OpenRecordset("Upcoming Sessions")
rcdNextSession.FindFirst ("Session_Date" >= Date)
If rcdNextSession.NoMatch = False Then
Me.Next_Session_Alert = "Next Session Will Be On " & rcdNextSession("Session Date") & " At " & rcdNextSession("Session Time") & ", " & rcdNextSession("Type of Session")
Else
Me.Next_Session_Alert = "This patient has no upcoming sessions scheduled"
End If
rcdNextSession.Close
End Sub
Here is the issue:
1) Whenever I make a change now to the subform (for upcoming sessions), I cannot click anywhere else on the frm_Client Info (the database does not change focus from the subform) and when I go to close the form it gives me an alert that the database cannot save the changes to the record. This is obviously a big issue and I am not sure how to get around it.
2)I cannot cause this to autoupdate the banner after the form has loaded. I tried to put the same code in frm_Client Info's timer event and After Update event but that did not work. I am guessing that these issues are very much connected...
PLEASE HELP ME! I need to get this working ASAP and I am not sure what the issue is... THANK YOU!!!!