Check Box Visible On Certain Days

Mar 27, 2006

Hiya

I'm trying to get a check box to be visible/enabled on Tuesdays, Thursdays and Sundays.
I've been dabbling with the code and 'DatePart' but with little effect. I've been trying other suggestions on other threads but am still struggling I'm afraid.
All help much appreciated, and I'm fairly new to access and have a large work objective to cope with, see below for my poor effort so far

Private Sub Datapulse_Enter()

If Datapulse = DatePart("1", "3", "5") Then
Datapulse.Visible = False
Else
Datapulse.Visible = True
End If

End Sub

View Replies


ADVERTISEMENT

Make Reports Visible When Reach A Certain Count (60 Days)

Jul 31, 2013

I have 2 tables on one report, 1 is visible, the other visible = no, Is there a way to make that visible = yes when you reach a certain count (60days)...

View 1 Replies View Related

Check Box = Visible/Enabled

Jun 16, 2005

Hi,

I am having a mare trying to do something which I think should be quite simple, as follows.

In a table I have the field [Entitled]. On my form I have this as a yes/no check box.

I have the following code in the VB.

Private Sub Check112_AfterUpdate()
If Me![Check112] = True Then
Me![Entitled].Visible = True
(or I could use) Me![Entitled].Enabled = True
Else
Me![Entitled].Visible = False
(or I could use) Me![Entitled].Enabled = False
End If
End Sub

Some people have the field checked and others do not.

The problem is; when I check or uncheck the box on individual records shown on the form, the value is remebered when I scroll to the next record (i.e. the box may be unchecked but the field is still visible/enabled). It is doing my head in! Help Please.

Mac

View 3 Replies View Related

Modules & VBA :: How To Check If A Subform Is Visible

Sep 25, 2013

I'm trying to check if a subform is visable. The following code is just test code so I can get a result. I keep getting an error on the .IsVisible section.

If datTimePlus15 <= datCurTime And [frmBarstockAreaSubForm].IsVisible Then
MsgBox datTimePlus15 & " " & datCurTime
datTimePlus15 = DateAdd("n", 1, Now)
End If

View 2 Replies View Related

Want Check Box On Switchboard Form To Set A Text Box's Visible Property In A Report

Sep 23, 2004

On my switchboard form, I have a check box which the user can check to make a text box (which appears in several different reports) visible and uncheck to make it invisible. The text box in the reports has the same name on all of them.

I am having trouble making this work.

I can think of two solutions, but haven't had success with either yet.

1. I could simply change the visible property of the report(s) control from the form. This works if the report is open, but throws an error if the report is not open.

Code:Public Sub showNumOrgsInReportCB_AfterUpdate()If Me!showNumOrgsInReportCB.Value = 0 ThenReports![publishZipR]![numOrgsF].Visible = FalseElseReports![publishZipR]![numOrgsF].Visible = TrueEnd IfEnd Sub

Is there a property or function I can use to test whether the report is open before I set the text box visibility?


2. Alternatively, a less elegant solution would be to run an event procedure to close all open reports. This would eliminate that issue, but I haven't gotten the code to work yet:

Code:Public Sub showNumOrgsInReportCB_AfterUpdate() Dim rpt As Report ' Enumerate Reports collection.For Each rpt In ReportsDoCmd.Close rpt.nameNext rptEnd Sub

This line:
DoCmd.Close rpt.name
throws a Run-time Error '13', Type mismatch.

How do I fix that?


I'm open to better ideas!

Thanks

View 2 Replies View Related

Forms :: Visible / Non-visible Combobox - Column Attribute?

Oct 17, 2013

I have a combobox on my form called TypeOfBusiness, with fields including Corporation, Education, Industry, Non-Profit. In order to make a second combobox called IndustryClassification appear when Industry is selected from the TypeOfBusiness combobox, I have used the following code:

Code:
Private Sub Form_Current()
If Me.TypeOfBusiness = "Industry" Then
Me.IndustryClassification.Visible = True
Else
Me.IndustryClassification.Visible = False

[Code] .....

It works just fine. However, when a user selects both, say, Industry and Education, the IndustryClassification combobox will not appear. What code I can use to ensure the IndustryClassification box will appear regardless if another box is checked in addition to Industry? I am wondering if it has to do with the Column attribute.

View 14 Replies View Related

Modules & VBA :: Make Controls Visible Or Not Visible?

Mar 24, 2015

I have a Main Form with a Sub-Form, the sub-form is base off a query. on the sub-form i have 8 controls, one of them is "Status' and "Process" and "Review" My Main Form have a Refresh command that refreshes the data in the sub-form.

What i am trying to do is make the "Process" Control only visible is "Status" is a certain status and "Review" visible if "Status" is something else. what i have done works correctly On Open. I run into and issue on the refresh command. I get Run-time error '2165' "You can't hide a control that has the focus"

Code:
If Forms!Main_Form.[Name subform]!Status = "Ready" Then
Forms!Main_Form.[Name subform]!Process.Visible = True
Forms!Main_Form.[Name subform]!Review.Visible = False
ElseIf Forms!Main_Form.[Name subform]!Status = "Reviewing" Then
Forms!Main_Form.[Name subform]!Review.Visible = True
Forms!Main_Form.[Name subform]!Process.Visible = False
End If

I have done similar with a main form and making sub-form visible or not based on a control on a main form and that has worked perfectly. I am not sure how the control is getting focus and cause the error.

View 4 Replies View Related

Queries :: Counting Days Between Dates - Vacation Period And Work Days

Sep 11, 2014

I have a form called subfrm_vactions

rowsource is a query called qryVacations

the query should calculated two things

1 - the difference between start_vac and End_vac in days to calculate the vacation period and put the value in field called Period (working well)

2-the work days which the period between the last day in Previous record (End_Vac) and the (Start_Vac) in the next record (didn't work)

the result is the difference between (End_Vac) and (Start_Vac) in the same record which i don't want

simply i want to calculate the work days.

View 5 Replies View Related

Reports :: Count Number Of Days Each Week (7 Days) Person Has Worked

Jan 24, 2014

I have to count the number of days each week (7 days) that a person has worked - simple enough.

But - what if they come off the job within the week?

I have been using the DateDiff function which is fine.

In the database they have a Mobdate and a DeMobDate but if the DeMobDate falls within the week the whole thing falls apart?

View 2 Replies View Related

Trouble Implementing The Regular Days And Sunday Working Days?

Dec 14, 2004

Hello everyone,

I have problem with my code here. I am using this code to determine if the LogDate with a weekday of Sunday can be declare as Sunday Work or Regular Work. The 1st week of my entry can determine if the LogDate is Sunday then compute if it reaches a 7 days working, if he is absent even 1 (one) day in his previous working days within the week. His Sunday LogDate is considered as Regular Days instead of Sunday Work. Can anyone tell me what is wrong in this code?

The problem here is the computation of 7 days after 1 week. There should be a 7 days computation every week per month in able to declare Sunday Work or Regular Work. I tried this code but it did not work on 2nd week, 3rd week and 4th week of the month.

How come on 2nd week, Sunday (LogDate) is not considered as Sunday Work even he completed the 7 days (working days) per week? I need help on this ASAP Thanks

Tim

Below is the code i'm using for defining Regular days and Sunday Working Days:


Private Sub LogDate_AfterUpdate()
Dim rst As DAO.Recordset, rs As DAO.Recordset
Dim db As DAO.Database
Dim dteToday As Date, dtePrior As Date
Dim i As Integer

dteToday = LogDate
dtePrior = DateAdd("d", -6, dteToday)

Set db = CurrentDb
Set rst = db.OpenRecordset("SELECT [HolidayDate] FROM tblHolidays", dbOpenSnapshot)

rst.FindFirst "[HolidayDate] = #" & dteToday & "#"
'See if the date entered is a holiday
If rst.NoMatch Then
Holiday.Value = 0
Else
Holiday.Value = 1
End If
If Weekday(dteToday) = vbSunday Then 'If dated entered is a Sunday determine if
Dim strSQL As String 'it will be a regular day or a Sunday

strSQL = "SELECT [LogDate] "
strSQL = strSQL & "FROM tblLog "
strSQL = strSQL & "WHERE [LogDate] >= #" & dtePrior & "#"
strSQL = strSQL & " AND [LogDate] <= #" & dteToday & "#"

'Create a recordset of records from date entered and 7 days prior
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)

rs.MoveLast
i = rs.RecordCount 'Count the number of days between the two dates

If i = 7 Then 'If there are seven days then it is a Sunday
Sunday.Value = 1
Else
Sunday.Value = 0 'If less than 7 days then it is a regular day
End If

Else
Sunday.Value = 0
End If

DayofWeek.Value = Format(dteToday, "dddd")

End Sub

View 1 Replies View Related

General :: Convert Weekend And Holiday Days To Work Days

Jun 14, 2013

Is there a way i can convert the weekend days into working days for example.

5/4/13 1:30 PM is on saturday what function can I use to make this day read 5/6/13 8:00 Am which is monday. Same thing for holidays.

View 1 Replies View Related

Queries :: Number Of Days Between Two Dates With Irregular Days Worked

Apr 14, 2014

I have a form where a start date is inputted (Inputfrm , StartDate) and a form where the end date of the process is recorded (Inspectionfrm , EndDate) and these both record in the table InputTbl as StartDate and EndDate respectively.

I have created a union query which shows a list of all the dates where there is work recorded (WorkingDatesQry and the column of list of unique dates is "WorkingDate"), and as we run a highly varied schedule depending on time of the year and order numbers I cannot just use a query which says Monday-Friday or Tuesday - Saturday.What I am trying to do is to find the number of days between StartDate and EndDate where there is a date recorded in the WorkingDates query.

View 1 Replies View Related

Queries :: Missing Days - Creating Table With 31 Days Of Zero Values

Apr 3, 2013

Client has asked me to create a report showing summary of monthly sales by day. That was easy. I created a query for the month the user selected and then summarized and group the data by day. Client like the result but would like to see zeros on the report for non sales days. Non sales days are days like holidays and there are no sales.

I am thinking of creating an table with 31 days of zero values and then join the two tables in a query? Or, should I create a temporary table with code and then merge the two tables which the existing query which I can then use for the report?

View 4 Replies View Related

Visible.Enabled Remaining Visible!

Sep 12, 2004

I have a form with four subforms set up in a tabs on the form. In the subforms I have a copuple of command buttons which enable/make visible fields when they are clicked (see previous posts but for eg) - if a height and a weight are added in two separate boxes a calculation is done and then a command button pressed to make visible the (label) which shows the mass index the patient falls into. My problem is that the label is then retained so if I click out of the form and re-enter with a new patient then the height and weight boxes are clear but the label from the previous patient remains.

I tried to put the code
Private Sub Form_Load()
If PtWeight = Null And PtHeight = Null And Text60 = Null Then
Label106.Visible = False
Label101.Visible = False
Label177.Visible = False
Label122.Visible = False
Label123.Visible = False
End If
End Sub
in both the open and on load event of the main form (not the subform) but it doesn't help. Any ideas?

(When should code be put on the main form and when on the subform?)

View 2 Replies View Related

Date Add Problem (calendar Days Vs Working Days)

Dec 4, 2006

I have a query and I need the records to display 3 working days before the 15 working day deadline.

I used the following in the criteria box below the received date field and it doesn't pull the correct number of workdays, it's pulling calendar days instead.

<=DateAdd("w",-12,Date())

Can anyone help, thanks for your time!!!

View 8 Replies View Related

Date Add Problem (calendar Days Vs Working Days)

Dec 4, 2006

I have a query and I need the records to display 3 working days before the 15 working day deadline.

I used the following in the criteria box below the received date field and it doesn't pull the correct number of workdays, it's pulling calendar days instead.

<=DateAdd("w",-12,Date())

Can anyone help, thanks for your time!!!

View 6 Replies View Related

Calculate Days In Advance Or Days In Arrears

Dec 26, 2006

I rent out a property , on the rental statement I have a field [Datepaid], [RentpaidFrom] and [rentpaidTo]. I would to have a field that can calculate the rent that is paid to show if the rent is in arrears or in Advance. I guess the code would be something like (datediff ???? etc) but i have no idea what it should be. the calculation should appear on the query as i.e.2 days in arrears or 12 days in advance etc

your help would be much appreciated

merry christmas to you all
Jabez

View 4 Replies View Related

Calculate Working Days Between 2 Days

Mar 14, 2006

Dear All,

I'm new to VBA coding. A code below is copied from a friend of mine and I can't make it work. How to call up this function in my form. In my form I have 3 text boxes (StartDate, EndDate and NumOfWorkDays). My form is based on a table.

Please anyone who would help me on this, kindly give me the step by step procedure as I am really novice. Thanks in advance.

'*********** Code Start **************
Public Function WorkingDays(StartDate As Date, EndDate As Date) As Integer
On Error GoTo Err_WorkingDays

Dim intCount As Integer

StartDate = StartDate + 1
'If you want to count the day of StartDate as the 1st day
'Comment out the line above

intCount = 0
Do While StartDate <= EndDate
'Make the above < and not <= to not count the EndDate

Select Case WeekDay(StartDate)
Case Is = 1, 7
intCount = intCount
Case Is = 2, 3, 4, 5, 6
intCount = intCount + 1
End Select
StartDate = StartDate + 1
Loop
WorkingDays = intCount

Exit_WorkingDays:
Exit Function

Err_WorkingDays:
Select Case Err

Case Else
MsgBox Err.Description
Resume Exit_WorkingDays
End Select

End Function
'xxxxxxxxxxxxxxxxxxxxxxxx

Can someone please direct me to the right path.

Your help is highly appreciated.

qwerty70

View 1 Replies View Related

Forms :: Make Image Appear In Form When There Is Check In Check Box From Table?

Jun 26, 2014

how can i make a image appear in my form when there is a check in the check box from the table?

View 14 Replies View Related

Access Application For Check-in/check-out

Mar 19, 2007

Long time lurker, first time poster.

I'm in need a of a check-in/check-out application for my company. We have about 550-600 employees at any given time and our turnover is about 20-30% per year. Our check-in/check-out process requires our employees to personally visit between 30-40 areas in our company (personnel, safety, credentials, parking, insurance, etc) within the first month of employment. This is currently done manually and is a huge drain on labor, especially when check-in sheets are lost, misplaced or, in some cases, forged.

I'm looking to build a database that would be intranet based, password secure (by check-in area) that would allow the new employee to present at a particular check-in, check-out site, complete that portion of the check-in/out process and then allow the person responsible for the check-in/out to enter the status into the database. At any point in the process, I would want to know the status of the person checking in/out (how long they've been checking in/out and what portion of the process have they completed).

Can this be done in ACCESS?

Thanks

View 1 Replies View Related

Visible

Dec 2, 2005

Hi,
On the form,

I have one field called "Tax", when I open the form, the "Tax" is invisible, when I click one button, then the "Tax" is visible, after the input the value, I want the "Tax" to be invisible. But it cannot be invisible.

Private Sub Tax AfterUpdate()
[Tax].Visible = False
End Sub

How can I fix it? Thanks.

View 7 Replies View Related

Visible

Sep 7, 2005

This might sound simple to everyone, but it won't work for me. I have a text box on my form that holds the current date, there are also other text boxes that hold other information. Here's what I'm trying to do, if the other text boxes are empty then I want the date text box to be invisible. Here's the code I'm trying to use:

Code:If [EquipmentType1]=" " Then[DateSigned].visible = FalseEnd IfEnd Sub

By the way this is triggered from the Form Load event. Thanks for any help you can provide.

Scott

View 3 Replies View Related

Spell Check Contents Works , Need To Suppress The Spell Check Complete Msg Box

Apr 25, 2005

Hi
I have sendkey "{f7}" on loss focus.
this works great as a spell check but then I get the mesage box that spell check is complete.
How do I stop this box from occuring?

View 2 Replies View Related

Form Always Visible?

Apr 29, 2005

I created a little form containing informations the users need to see to insert the right values in other forms. I need to have this little form always visible even if the users are working with another form maximized.
Does it exist a code to do it?

View 4 Replies View Related

Set Visible By Keyword

Aug 16, 2005

In my form, I have a combo box with one of three options (cash, check, reimbursement). If the user chooses check, I want a text box to become visible, so the user may input the check number.

I thought I could use another invisible text box to store the value of the combo box and then in the code put:

Private Sub Text64_AfterUpdate()
If Text64 = "Check" Then
Me.Check1.Visible = True
Else
Me.Check1.Visible = Refresh
End If
Me.Refresh
End Sub

Text64 is holding the value of the combo box
Check1 is the text box where I want the user to put the check number.

Please help. Thanks

View 14 Replies View Related

Button Visible

Aug 25, 2005

Hi could someone help me with the following please:

when a click on 'Button A' i want Button B, Button C and Button D (not yet visible) to appear. Then when i click on Button A again i want them to dissappear. Im sure this is easy!

Thanks

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved