Forms :: IF Statement - Condition Based On Status Of One Checkbox
Aug 2, 2014
In an access form, I have several checkboxes. There is one checkbox titled "Complete". The complete checkbox needs to be true only if all other "non master" checkboxes are true. If all of the non master checkboxes are not checked, I need the complete checkbox to be false. This is the code that I am currently using on the after update command:
If me.checkbox1 and Me.checkbox2=True then
me.completed=True
else
me.completed=False
end if
This works fine if there is no "and" in the if statement and the condition is based on the status of one checkbox as opposed to many (Also I have about 15 checkboxes that must be checked before the "complete" checkbox is true).
View Replies
ADVERTISEMENT
Mar 8, 2013
My database has a text field "Status" where the text is either, A, W, C. There is a form to update this field; currently it uses a standard Access created text field. The users want a checkbox which will show up as checked when the status is W, if the status is anything else, the checkbox will be blank. If the user clicks the checkbox within the form the status will be changed to W.
If [table.status] = 'W'
then checkbox = 0
else
checkbox = -1
and then somewhere on the update it would be
if checkbox = -1 then [table.status] = R
Except that Access doesn't think the way I do.
View 1 Replies
View Related
Aug 9, 2014
Is it possible to create a VBA on the AfterUpdate() that flips a value based on a condition?
For example, if in a text box (Gender) there is a value of "Male" and in a combo1309 the value is "No", can Gender be switched to "Female" automatically?
Code:
IF Me.combo1309 = "No" Then Me.gender....
View 1 Replies
View Related
Feb 10, 2014
I need to design a query that contains about a dozen fields for stationery items along with another dozen fields (checkboxes) to show whether these items were delivered (Yes, I know, not great db design).
I ran out of space with the the query criteria window.
View 6 Replies
View Related
Jan 25, 2015
I have a calculated field in the form footer which adds up the number of boxes that have been ticked for the received field
=Sum(IIf([Recieved]=Yes,1,0))
If the ticks equal to 3 then I want to update the status field in another table to "Active".I am trying this VBA code but it won't work.
Code:
If Text9 = "3" And custNumber = tblCustomers.custNumber Then
tblCustomers.Status = "Active"
View 3 Replies
View Related
Mar 8, 2006
i'm making form from query. but all i need to do is calculate days worked (TimeService) either worker still working or resigned.
i want to know is it possible to make it condition like it to query? if not can u tell me the other way?
View 2 Replies
View Related
Jul 17, 2015
I have a form that has a listbox and a subform. The listbox lists names of events, start date and end date. The subform bellow reveals names of participants to the event that is clicked in the listbox. Against each participant's name is a button to delete the participant.How can I hide or disable the delete button if the start date of the event is past?
View 1 Replies
View Related
Aug 26, 2013
My subform consists of a list of tasks that are waiting to be verified. in order to verify tasks, the user scrolls through the list of tasks and checks a checkbox (discrepancyverified) on each record they wish to verify. After the user has finished checking all the records they wish to verify, they click a verify button on the main form which should then go back through each record and update the verifieddate value of any that are checked to today.
This is what I have so far:
Code:
Private Sub Command19_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim ctl As Control
Dim varItem As Variant
[code]...
View 3 Replies
View Related
Oct 31, 2006
Hi, im very new to visual basic programming...what i am trying to do is implement an If Statment on AfterUpdate for my form:
If record_is_new Then
Dim db As DAO.Database
Dim RS As DAO.Recordset
Set db = CurrentDb()
Set RS = db.OpenRecordset("LTOT_second_oxygen", dbOpenDynaset)
RS.AddNew
RS![HospitalNumber] = Me![general_info.HospitalNumber]
RS.Update
RS.Close
db.Close
Set RS = Nothing
Set db = Nothing
.........more of this kind of code
Else nothing
End If
any ideas on the vb code that would do this?
View 5 Replies
View Related
Feb 10, 2015
Currently we track areas of non-conformance for a fleet of flight simulators. Each flight simulator has a particular ID number. In some instance an area of non-conformance is associated with a single simulator, at other times it is a fleet wide issue and applies to all or some simulators. In order to track as well as advise leadership and the contractor responsible for maintenance of the simulators of the situation we generate individual response letters.
In order to track each instance of non-conformance my idea was to create a new record for each deficiency. In the event that it is applicable to multiple simulators I would like to fill out the form with all pertinent data and then place a checkbox associated with each simulator and when the record is saved, it creates one record for each simulator with a checkbox ticked.
Once the deficiency on each simulator is fixed, I would check a box for a field called rescinded, which would remove that particular deficiency on that particular simulator from the active list of deficiencies but the others would still remain because they are associated with unique records.
View 14 Replies
View Related
Feb 15, 2014
I am trying to lock records on a form and subform after a checkbox has been ticked, have used the code below from a previous post.
Private Sub Form_Current()
If Locked = -1 Then
Me.AllowEdits = False
Me.AllowAdditions = False
Me.AllowDeletions = False
[Code] .....
This is locking the Main form records is there a way to code this so that the fields on the subform are also locked when the checkbox is ticked?
View 7 Replies
View Related
Feb 24, 2015
I'm trying to have a single or multiple query criteria based on what the user checks on a form.
I can't get the True condition to work at all, I get no records. Here is what I'm using
IIf([Forms]![FrmAttendanceLogsRpt]![BlkFilter]=-1,[TempVars]![EID] Or 86,[TempVars]![EID])
If I just put
[TempVars]![EID] Or 86
in the Criteria it works just fine.
View 14 Replies
View Related
Jul 30, 2014
I need a pop-up form that is based on an if then statement.
For example if there is a certain customer selected on the form and the detailed bill is more than 10 lines long (I have a count field) then I need a box to pop-up that says....
REMINDER: You will need to manually reformat this 500byte file.
I also need another one that pops-up when the record loads that warns if a purchase order field is blank.
View 4 Replies
View Related
Jan 25, 2007
I'm trying to create a report eventually, however, I need to get my query set up.
My report should look like the following when complete.
Timeframe (mth,qtr,year)
# of Total Projects Completed - regardless of status
# and % of Projects Completed within Requested Delivery Date
# and % of Projects Completed within Committed Delivery Date
# and % of Projects Completed within Requested and
Committed Delivery Date
I have 3 different fields to base my calculation from:
Actual Delivery Date
Requested Delivery Date
Committed Delivery Date
I have created 2 new fields that calculate the number of days:
[Actual Delivery Date] - [Requested Delivery Date]
[Actual Delivery Date] - [Committed Delivery Date]
I'm trying to set up a "Status" field to indicate whether the project was completed "Within Requested", "Within Committed", or "Within Requested and Committed", however, I'm stumped. I've tried an Iff statement to no resolve. I don't want 10 queries just to get me there either.
Please help! :confused:
Thanks!
View 2 Replies
View Related
Oct 5, 2006
Hi All
I have a residential address and a postal address on my form. What I want to do is when the user completes the 3 fields from the Residential Address Eg: Address, State, Postcode and then ticks the checkbox (Residential Address is Postal Address), the information previously entered will automatically fill the same fields in the Postal Address.
If Checkbox1 = true then
RAddress = PAddress
RState = PState
RPostcode - PPostcode
End If
I just can't work out the correct code.
Many thanks for any help.
View 5 Replies
View Related
Mar 21, 2006
I am not sure if what I am about to ask is best done in a query, table or report, so I thought I would post this in the query section of the forum.
I have a table that contains the following fields (plus other fields)
RC_START_DATE
RC_DUE_DATE
RC_APPROVAL_DATE
RC_STATUS
On one of my reports, I want to show the "Days Open". If the RC_Status is "Active" I want to calculate the "Days Open" by subtracting RC_START_DATE from Today(). However if the RC_Status is "Closed" I want the "Days Open" to be calculated by RC_APPROVAL_DATE minus RC_START_DATE.
So the question is, what is the best way to do this and how would I write the formula to calculate this?
Thanks for the help.
Jim
View 6 Replies
View Related
Aug 5, 2014
What is the correct way to update the checkbox value in a table with an IF statement?
Desired Result:
Check if UserID is not 'ME'
If it is not 'ME' then uncheck the box in the table.
My current faulty code below:
NoUser = DLookup("[UserID]", "[TABLE]") If NoUser <> "ME" Then
[AllowLogin] = 0
End If
View 1 Replies
View Related
Jan 25, 2015
I have a question regarding counting of text values base on their status and using that result to a calculation.
Say, I have a table of Demand of Positions, wherein, I have a specific Job Title for a certain Department that have number of workers needed (demand quantity) and a table of candidates for that job title and their status, say, Arrived, Visa Processing, Visa Applied, Visa Issued, and With Ticket.
What I would want is to make a summary out of the two tables, where the query will count how many candidates are there in that specific job title and have a field of status say, field of Count of Arrived, Count of Visa Processing and etc., and a field where I can add all of the count of candidates per status and deduct the result to the demand quantity where that field would be named Balance.
The problem is that the status varies on every candidate on that specific job title because the status field is used to track the progress of each candidate and this scenario will make the query blank because there would be no such record due to their status.
I tried making a summary following my requirement and you will see that in the attached file together with the SQL code of that query that the balance field value is blank.
View 2 Replies
View Related
May 16, 2014
I'm trying to get an Insert statement to execute whenever the user ticks the tickbox however my code is failing to find the output table 'Manager':
Code:
Private Sub Check34_AfterUpdate()
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim varItem As Variant
Dim strCriteria As String
[Code] .....
View 6 Replies
View Related
Jan 24, 2006
I have 2 combo boxes which I select a 'Year' and an 'Incident'. Based on 'incident', a listbox lists whether it was a 'bad' or 'good' incident.
I only want my subform to pull up the record if the listbox says 'bad'. how do I do that?
View 3 Replies
View Related
Aug 7, 2015
I want to update a table called tblFinalOrder, that looks like this:
In particular, I want to update each column separately with the number 1 taken from table tblSAP_XWP_SW:
My problem is that Access doesn't properly update the table how I want. I join both tables using an INNER JOIN on the SAP number. In the column AEMenge you see some 1's. So what he should do is writing these 1's into the appropriate column in my tblFinalOrder table. The condition is that the SAP number must already be in my tblSAP_XWP_SW table. If he doesn't find a 1, then skip it.
Here is my code so far. This one should update column "DynaCT". The funny thing is that DynaCT isn't available in my columnlabel column but he writes a 1 anyways (or in this case anohter number, I was playing around with it). This is what I don't understand.
Code:
UPDATE tblFinalOrder AS a
INNER JOIN tblSAP_XWP_SW AS b
ON a.SAPNr = b.sapxwpsw_sapnr
SET a.DynaCT = 1
WHERE a.SAPNR IN (SELECT sapxwpsw_sapnr FROM tblSAP_XWP_SW);
I mean, he should only write the 1 into the specific column of table tblFinalOrder, if he finds the SAP number in tblSAP_XWP_SW and if there is a 1 in this line in column AEMenge.
View 3 Replies
View Related
Apr 18, 2013
I'm having an issue getting my query to omit records with a blank field - in fact, it omits all records.
What I'm trying to do is:
I have a list of customers, with phone and email addresses. I want to filter via query for only customers with their email address's entered.
Here is what I have:
IIf([Forms]![AdvancedReporting]![Check230]=-1,"*",Null)
View 14 Replies
View Related
Apr 5, 2005
How would I get a report to only show records that have a check box called "Display" checked? I have tried some code, I even put it in a couple of different places, but it still doesn't work. I put the code on the on click event of the command button that opens the report and I tried the code in the on open event of the report. It did not work either time. Here is the code that I tried.
'Display only records that have the box checked
If IsNull(Display) Then
DoCmd.GoToRecord , , acNext
End If
End Sub
Can anyone help me???
learnasugo
View 3 Replies
View Related
Oct 14, 2004
Good day to all :
I have created a form based on a query. On this form, there are command buttons that when pressed, exports a file to excel. This export is based on a query, then using a macro using the TransferSpreadSheet action. It works great.
On this form there is a check box which is tied to each person on the form. Is there any way to export to Excel ONLY THOSE PEOPLE WHO ARE CHECKED?
Many thanks in advance,
Dion
View 3 Replies
View Related
Aug 12, 2013
I have table.[reconciled] tat allows for a check box. i want to enter in the criteria filed in query design that i only want to see the unchecked or false entries. i have tried writing the criteria multiple ways and i cannot get it to filter out on my sub form query.
SELECT FuelmanImport_tbl.Reconciled, [Driver PIN].Division, [Driver PIN].[Transportation Supervisor],
FuelmanImport_tbl.[Transaction Date], FuelmanImport_tbl.[Card Number], [Driver PIN].Driver,
FuelmanImport_tbl.[Cardholder Name], FuelmanImport_tbl.[Prompted ID], FuelmanImport_tbl.[MCC Description],
FuelmanImport_tbl.[Merchant Name], FuelmanImport_tbl.[Merchant Address], FuelmanImport_tbl.[Merchant City],
[Code] ....
View 14 Replies
View Related
May 6, 2015
I have set up a form that allows me to enter information on an item. This form is for initial entry, like an asset item. In this form I have a field for status of the item and the condition of the item.
Where I am having trouble is being able to bring the item up and change the status of the item if it is broke or damaged. I have the item as [label] and set as the primary key. and an item as [studentid] as a foreign key. I also would like to be able to query the different status'.
I am confident I can set queries up but I need to figure out how to recall the [Label] change the [status] and save it. The only other thing that I could hope for is to track then number of times the [status] was changed.
View 1 Replies
View Related