I have a continuous form, and I have set a couple of the text boxes in the Header section to sort by the corresponding field in the Detail section. It was working fine, but now it isn't, and I don't know why.
The only thing I can think of is, I changed the field name at one point, to remove a "/" character from it. But I believe I have changed everything else I need to change in order to deal with that. Possibly not.
Here's what the form looks like normally.
Clicking the "Over/Under" label used to make the form sort (highest number first) by that field, but it is no longer working. Clicking the header does make the form refresh (I assume anyway, as I can see the OverUnder field go blank for a moment), but the form isn't sorting anymore based on it.
Here's a couple of screenshots from Design View of the form.
I have the Over/Under label selected, so you can see that an event happens On Click. (I'll paste that code below.)
Here I have the OverUnder field selected in the Detail section. Its Control Source is a function, because it is doing a calculation and error checking. Essentially, it is displaying the result of Points - PointsNeeded. The Function is working properly. When I change the value in the Points column, the value in the OverUnder field changes, just as it is supposed to.
Here is the code that On Click is tied to:
The Record Source of the form is a query. Here is the SQL from it:
Here is the SQL from the same query from an older version of the database, back when clicking the Over/Under header was working:
In the SignInSheets table, the name of the field has been changed from "Over/Under" to "OverUnder".
OverUnder is Short Text because on occasion, it will hold a letter instead of a number.
I am pretty new to Access (and databases in general), so I am having no luck figuring out what is wrong. Any help would be greatly appreciated.
The only thing I can think of is, I changed the field name at one point, to remove a "/" character from it. But I believe I have changed everything else I need to change in order to deal with that. Possibly not.
Here's what the form looks like normally.
Clicking the "Over/Under" label used to make the form sort (highest number first) by that field, but it is no longer working. Clicking the header does make the form refresh (I assume anyway, as I can see the OverUnder field go blank for a moment), but the form isn't sorting anymore based on it.
Here's a couple of screenshots from Design View of the form.
I have the Over/Under label selected, so you can see that an event happens On Click. (I'll paste that code below.)
Here I have the OverUnder field selected in the Detail section. Its Control Source is a function, because it is doing a calculation and error checking. Essentially, it is displaying the result of Points - PointsNeeded. The Function is working properly. When I change the value in the Points column, the value in the OverUnder field changes, just as it is supposed to.
Here is the code that On Click is tied to:
Code:
Private Sub OverUnder_Label_Click()
'This will sort the results by OverUnder.
Me.OrderBy = "OverUnder"
Me.Refresh
End Sub
The Record Source of the form is a query. Here is the SQL from it:
SQL:
SELECT SignInSheets.SignInSheetID, SignInSheets.TournamentID, SignInSheets.MemberID, SignInSheets.Points, SignInSheets.OverUnder, SignInSheets.Present, SignInSheets.Winnings, SignInSheets.Notes, SignInSheets.PointsNeeded, SignInSheets.ScoreRecorded, SignInSheets.DuesRecorded, SignInSheets.CurrentOnDues, Members.FirstName, Members.LastName, Members.FullName, Tournaments.TournamentDate, Courses.CourseName
FROM Courses INNER JOIN (Tournaments INNER JOIN (Members INNER JOIN SignInSheets ON Members.MemberID = SignInSheets.MemberID) ON Tournaments.TournamentID = SignInSheets.TournamentID) ON Courses.CourseID = Tournaments.CourseID;
Here is the SQL from the same query from an older version of the database, back when clicking the Over/Under header was working:
SQL:
SELECT SignInSheets.SignInSheetID, SignInSheets.TournamentID, SignInSheets.MemberID, SignInSheets.Points, SignInSheets.[Over/Under], SignInSheets.Present, SignInSheets.Winnings, SignInSheets.Notes, SignInSheets.PointsNeeded, SignInSheets.ScoreRecorded, SignInSheets.DuesRecorded, Members.FirstName, Members.LastName, Members.FullName, Tournaments.TournamentDate, Courses.CourseName
FROM Courses INNER JOIN (Tournaments INNER JOIN (Members INNER JOIN SignInSheets ON Members.MemberID = SignInSheets.MemberID) ON Tournaments.TournamentID = SignInSheets.TournamentID) ON Courses.CourseID = Tournaments.CourseID;
In the SignInSheets table, the name of the field has been changed from "Over/Under" to "OverUnder".
OverUnder is Short Text because on occasion, it will hold a letter instead of a number.
I am pretty new to Access (and databases in general), so I am having no luck figuring out what is wrong. Any help would be greatly appreciated.