Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar to track lab test results 1

Status
Not open for further replies.

jeannier1975

IS-IT--Management
Aug 14, 2019
22
US
I have a form that i for from old post that MapJ wrote but having a hard time getting the code to work. my form looks like the attachment . i have the following code that i am trying to input the dates depending on a year that is selected but i get an error. Run time error 424 Object required. I an very new to this and im going off at a whim. any help would be greatful.
calendar_qjfnyq.png
 
 https://files.engineering.com/getfile.aspx?folder=2b54e322-2e9c-40d2-a52b-768ab8514af2&file=FillTextMod.txt
Which line of code causes the error?

Do you also have a function named isHoliday() in your application?

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
i think it has an issue with FillMonthLabels sub routine because it wont add the labels to the form
calendar2_ol7tec.png
 
At the point where the debug window pops up, I would press Ctrl+G to view the immediate window. Then enter this into the window:

Code:
? Me.Name

? dtpYear

If these return the expected values, then I would press F8 to step through the code line by line.


Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Is dtpYear a combo box or some other control? Is a date entered or just the year? I believe it is expecting a full date. I typically NEVER use the On Change event. I use the After Update event.

Did you attempt to use the F8 key to step through the code as suggested?

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
dtpYear is a list box " - it would be nice and beneficial (for everybody, but especially YOU) to use widely accepted VBA naming conventions.
In [tt]dtpYear[/tt] - dtp says to me "Date Time Picker", but it is a List Box.
For a ListBox I would expect the control to be named [tt]lstYear[/tt]


---- Andy

There is a great need for a sarcasm font.
 
im trying to download the file here but keep getting a error.
 
calendar_3_v1lgul.png

i keep getting an error i have been going through the code i am stumped
 
Your code doesn't include the function getFirstOfMonth().

There will probably be other missing functions.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
jeannier1975,
I have a feeling you are no better off now then when you began this thread.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
I got your sample file to work by:

[ul]
[li]Created a small table named YearsQ with a single numeric field named Years and added values 2015, 2016, 2017, ..., 2035.[/li]

[/ul]
[ul]
[li]Renamed the lblJan8 from its previous name. These are the gray labels controls to the right of [highlight #BABDB6]Jan[/highlight]. Just count over 8 controls and see the labels to the left and right of lblJan8 are lblJan7 and lblJan9.[/li]

[/ul]
[ul]
[li]Commented out IsHoliday line in code. You would need to add a table of holidays and then write the function.[/li]
[/ul]
Code:
       If intDay > 0 And intDay <= DaysInMonth Then
         ctl.Caption = intDay
         ' If IsHoliday(FirstDayOfMonth + (intDay - 1)) Then ctl.BackColor = vbGreen
       End If
[ul]
[li]Changed the function call to correct the name of the drop down[/li]
[/ul]
Code:
Private Sub dptYear_Change()
    FillMonthLabels Me, [highlight #FCE94F]Me.dptYear[/highlight]
End Sub

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
I would like to thank everyone for their help and assistance [gorgeous]
 
ok i got it to work but i need to add some conditional formating based on labtest result
I need to put this on the text boxes on the calendar for the test done for listeria in a given location.
legend_al7hjw.png

i have created a query for the test restults which is.
SELECT [14DayFollow-upFallOffT].Location, [14DayFollow-upFallOffT].SWabDate, [14DayFollow-upFallOffT].Result
FROM [14DayFollow-upFallOffT]
ORDER BY [14DayFollow-upFallOffT].Location, [14DayFollow-upFallOffT].SWabDate;
 
 https://files.engineering.com/getfile.aspx?folder=c45d9bc6-f6f1-4a29-9d8c-8201ef809989&file=test_calenddar.accdb
There is no data with dates or test results. The conditional formatting is limited via the interface to I think 3 unique conditions. It looks like you have 8-9. I expect you could write code that sets the properties but it's a bit difficult with no data. Do you have a table of results with each unique type of result? Something like:
[pre]
tblResultTypes
1 Confirmed Negative
2 Confirmed Positive
3 Presumpt...
4 Required ...[/pre]

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top