Access Form - datasheet view, which OnEvent
-
Hi. I am creating a form that will show results of a query in a "Datasheet View" - multiple records on one form with a header at the top of each column of data. I want to know which event can i use to react to a new record being "loaded"? My desire is to display a different label (text control) only when a field's value (date) changes by record. If I have several records, i want a visual indicator showing change in dates (one label for all Day-1's data, then only one (new) label for all Day-2's data, then only one (new) label for all Day-3's data, ....) Thanks. Johnny J
-
Hi. I am creating a form that will show results of a query in a "Datasheet View" - multiple records on one form with a header at the top of each column of data. I want to know which event can i use to react to a new record being "loaded"? My desire is to display a different label (text control) only when a field's value (date) changes by record. If I have several records, i want a visual indicator showing change in dates (one label for all Day-1's data, then only one (new) label for all Day-2's data, then only one (new) label for all Day-3's data, ....) Thanks. Johnny J
From my understanding of Access, you can't have multiple header while displaying data in "Datasheet View", there is only one set of headings at the top of the grid. You can change the background color of cells to give the effect of a "green bar" report making the Day 1 data stand out from the Day 2 data. I believe you want to play around with the Events "Before Render", Before Layout, etc. I've never done it with a datasheet view, but I have created Reports where I would BOLD dates of tasks that were late. The event in the report I believe are "On Print". Good luck. :thumbsup:
-
From my understanding of Access, you can't have multiple header while displaying data in "Datasheet View", there is only one set of headings at the top of the grid. You can change the background color of cells to give the effect of a "green bar" report making the Day 1 data stand out from the Day 2 data. I believe you want to play around with the Events "Before Render", Before Layout, etc. I've never done it with a datasheet view, but I have created Reports where I would BOLD dates of tasks that were late. The event in the report I believe are "On Print". Good luck. :thumbsup:
Thanks for the advice. I added a text control, separate from the record "set" to which the rest of the form is related. I just shoved the other controls to the right so that I can squeeze my text control to look like it occupies it's own column. My idea was to have my new text control filled with the date, for that group of records with the same date. Only showing that date once. I have my own function that identifies the date for each record and could do something like MyTextCtrl.value = strDateLabel (when I figure out how to react to the right Event.) Thanks again, i will give your ideas a try. JJM
-
Thanks for the advice. I added a text control, separate from the record "set" to which the rest of the form is related. I just shoved the other controls to the right so that I can squeeze my text control to look like it occupies it's own column. My idea was to have my new text control filled with the date, for that group of records with the same date. Only showing that date once. I have my own function that identifies the date for each record and could do something like MyTextCtrl.value = strDateLabel (when I figure out how to react to the right Event.) Thanks again, i will give your ideas a try. JJM
Ah ha. I think I see what you are doing. How about this ... When you are building your dataset with a query, add a column where you can calculate a value you want displayed. For example: SELECT Payroll.WKNum, IIf([wkNum] Mod 2=0,"Even","Odd") AS OddEven FROM Payroll; This query displays the Payroll Week Number and a Text value of "Even or Odd" This would free the DataSheet View from having to do any logic processing on the dataset, it would just display it. If you need more complex logic, maybe you could extend this by manipulate a temporary table, then display that contents. Give it a shot. :cool: