-
WSFay Yocum
AskWoody LoungerYahoo. It worked it must of been the Dim statement. I just copied and pasted into the code what you had written. Thank you Jack. Now I can move on to something else I don’t know what I am doing. Thanks Fay
-
WSFay Yocum
AskWoody LoungerYes a zillion times. With quotes it figures just the Else line. If I take the quotes off I get a Run Time error 13. Thanks. Keep this up I will not need my comb because there won’t be anything thing left on my head to comb.
Fay
-
WSFay Yocum
AskWoody LoungerThe table field is a Yes/No field it goes into txtProrated textbox. Which displays 0 or -1. When I run the code as listed below it now runs the formula for the Else part of the statement and places it on the proper page. But nothing I do will make the If part of the statement run. If I take the guotes off around No then I get a compiler error. Further more if I reverse the two txtMonthlyStandard formulas only the Else formula runs. I either end up with 9 correct answers or 1. (not good)
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
‘ Figure monthly standard prorated vs non prorated
Dim txtProrated As String
If [txtProrated] = “No” Then
txtMonthlyStandard = [txtAnnualStandard] / 12
Else
txtMonthlyStandard = [txtAnnualStandard] / [txtMonthsProrated]
End If
End SubThis is making no sense to me. Thanks for your help. Fay
-
WSFay Yocum
AskWoody LoungerOkay here is where I am. I placed the code in the On Format Event of the detail section. The code now looks like this.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
‘ Figure monthly standard prorated vs non prorated
Dim txtProrated As String
If [txtProrated] = “No” Then
txtMonthlyStandard = [txtAnnualStandard] / 12
Else
[txtProrated] = “Yes”
txtMonthlyStandard = [txtAnnualStandard] / [txtMonthsProrated]
End If
End SubNo error messages received.
Now the only resutls in the txtMonthlyStandard is the results for the Prorated person. Everyone else has no values in the txtMonthlyStandard textbox. I have even tried placing a textbox on the form with a value of 12 in it and referencing it instead of putting 12 in the formula. With no luck or results.I appreciate the help. Thank you. Fay
-
WSFay Yocum
AskWoody LoungerI am really out of my element here. I think I Dim the Month text entry correctly. Originally the Month textbox way placed on the report so that the Month would be placed at the top of the report to identify what month the data was summarizing. I guess you are asking if I will be doing an error message box if a number or abbreviation is entered. Yes. But one problem (new skill) at a time please.
Private Sub Report_Open(Cancel As Integer)
‘ Figure TotalUOS/Expected
Dim Month As String
Dim strTotalUOS As Integer
On Error Resume Next
strTotalUOS = Month
Select Case Month
Case “July”
txtTotalUOS = ([LengthofService Grand Total Sum] / ((DLookup(“AnnualUOSTotal”, “tblCompanyFacts”) / 12) * 1))
Case “August”
txtTotalUOS = ([LengthofService Grand Total Sum] / ((DLookup(“AnnualUOSTotal”, “tblCompanyFacts”) / 12) * 2))
Case “September”
txtTotalUOS = ([LengthofService Grand Total Sum] / ((DLookup(“AnnualUOSTotal”, “tblCompanyFacts”) / 12) * 3))
Case “October”
txtTotalUOS = ([LengthofService Grand Total Sum] / ((DLookup(“AnnualUOSTotal”, “tblCompanyFacts”) / 12) * 4))
End Select
End SubShould this be done on the Open event or would it be better to create a Public Sub?
Thank you. Fay
-
WSFay Yocum
AskWoody LoungerNovember 26, 2001 at 3:42 pm in reply to: Making a label visible when printing (Access 2002) #554099I did what you said in the last post and it worked well until I tried to print the report via the “normal” way. I only want the label visible if I go throught the cmdApril button off the frmClient form. The button is only visible in April. I altered the code to the following
Private Sub Report_Open(Cancel As Integer)
‘Makes the label “End of Year Report” visible _
during the month of April for this report
If Month(Date) = 4 Then
Me.lblEndReport.Visible = True
Else
Me.lblEndReport.Visible = False
End If
End SubThis works. But, isn’t there always a but. Can I alter the “If Month(Date) = 4 Then” line to instead be based on the fact that the cmdApril button was clicked?
Thanks! Fay
-
WSFay Yocum
AskWoody LoungerNovember 26, 2001 at 11:41 am in reply to: Making a label visible when printing (Access 2002) #554068The label in question is on the subreport. Thank you for the form info.
You were correct the code Me.subrptHUDYearlyTotals!lblEndReport.Visible = True did not work.
Normally this report is printed from a reports switchboard page. But at the end of the grant year I want to be able to mark the report as the year end report, hence the need to make a label visible only once. The button that is clicked is on the main form and only appears in April.
What I wanted to happen is for the label to become visible prior to printing. How would I use the open event of the report to see if the form is open and make the label visible only when the April button is pressed on the main form? Thanks Fay
-
WSFay Yocum
AskWoody LoungerI had formatting set in the field name of the queries. Corrected that and yahoo it is working correctly. You are a sweetheart with a great head. Thanks for peeking in on the tail end of a holiday weekend. I hope you had a great one. Thanks!!!!! Fay
-
WSFay Yocum
AskWoody LoungerNovember 26, 2001 at 2:27 am in reply to: Making a label visible when printing (Access 2002) #554036This is the line I used and it isn’t working.
Me.subrptHUDYearlyTotals.Form.lblEndReport.Visible = True
subrptHUDYearlyTotals is the subreport name
lblEndReport is the label that I need to be visible.I don’t think I am sure what you meant by subformControlName. Also why is the word Form used when calling for a control on a report?
Thanks for your help.
-
WSFay Yocum
AskWoody LoungerYes I did and I just did it again and still get the error message. I have since gone back to the query and made an expression that will give me the half value. So my next problems is to add that to the value of another control and get a third figure in a third unbound textbox. I enter the following =[ADAMHSPercent]+DLookUp(“BothHalf”,”qryBoth”) and get 51.68%9.8%.
I don’t have a lot of experience but I am really baffled why this isn’t working. Thanks Fay
-
WSFay Yocum
AskWoody LoungerI typed =19.75 in the actual text box from BothPercent and it divided out equally. Go figure.
Thanks for helping. Fay -
WSFay Yocum
AskWoody LoungerThat expression returns a value of 19.75%. I went back to the table that the data came from it was set as text data type. I changed it to Number, long int. But that did nothing to help.
Thanks Fay
-
WSFay Yocum
AskWoody LoungerThat is a possibility. I guess that will need to be checked next week. Thanks
Have a good holiday.
Fay
-
WSFay Yocum
AskWoody LoungerHi Mark thanks for your reply.
JuneYear is a field in the tblCompanyFacts. The table has only one record. The data stored in that field reads “Between #6/1/2001# And 5/31/2001#”. I need that string to be placed in the query field criteria row and act to restrict the records used to within those dates. Just as it would if you type the sting into the criteria row.
Would you use the DLookup in the criteria row written like this [DLookup(“JuneYear”,”tblCompanyFacts”)]?
Thanks again Mark. Fay
-
WSFay Yocum
AskWoody LoungerThanks guys for responding. I used a table and was able to pull the number into an unbound text box on a form and that worked well. Thanks, but as usual answers lead to more questions. So here goes.
Another reused fact is the fiscal year (July to June). Which I have set in various queries as Between #7/1/2001# And #6/30/2002#. In a meeting yesterday I came away with having to track three different years: the fiscal year, a April to March, and June to May. I don’t want to have to go in next year in umpteen places and changes those dates. Will the DLookup still work in those situations?
How do I write the DLookup in a query. I have tried =DLookUp(“JuneYear”,”tblCompanyFacts”) and without the = in the criteria line. I get the message that: “Your tried to execute a query that does not include the specified expression…” I have the total criteria set to expression, otherwise I get a data type mismatch message.
Next question what is your opinion table versus form to use as the base of the DLookup which is easier to handle?
Thank you. Fay
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
TotalAV safety warning popup
by
Theodore Nicholson
3 hours, 34 minutes ago -
two pages side by side land scape
by
marc
22 hours, 47 minutes ago -
Deleting obsolete OneNote notebooks
by
afillat
1 day ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
3 hours, 44 minutes ago -
Security Essentials or Defender?
by
MalcolmP
6 hours, 29 minutes ago -
April 2025 updates out
by
Susan Bradley
49 minutes ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
24 minutes ago -
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
6 hours, 57 minutes ago -
Creating an Index in Word 365
by
CWBillow
16 hours, 26 minutes ago -
Coming at Word 365 and Table of Contents
by
CWBillow
7 hours, 55 minutes ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
1 day, 19 hours ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
1 day, 23 hours ago -
W11 24H2 – Susan Bradley
by
G Pickerell
2 days, 1 hour ago -
7 tips to get the most out of Windows 11
by
Alex5723
1 day, 23 hours ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
1 day, 16 hours ago -
I installed Windows 11 24H2
by
Will Fastie
1 hour, 49 minutes ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
2 days, 4 hours ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
30 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
2 days, 12 hours ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
1 day, 21 hours ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
1 day, 21 hours ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
3 days, 5 hours ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
3 days, 14 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
2 days, 16 hours ago -
Mail from certain domains not delivered to my outlook.com address
by
pumphouse
2 days, 22 hours ago -
Is data that is in OneDrive also taking up space on my computer?
by
WShollis1818
3 days, 9 hours ago -
Nvidia just fixed an AMD Linux bug
by
Alex5723
5 days, 1 hour ago -
50 years and counting
by
Susan Bradley
1 day, 23 hours ago -
Fix Bluetooth Device Failed to Delete in Windows Settings
by
Drcard:))
2 days, 2 hours ago -
Licensing and pricing updates for on-premises server products coming July 2025
by
Alex5723
5 days, 12 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.