Forms :: Switch Value Based On Condition?

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 Replies


ADVERTISEMENT

Forms :: Update Value In A Field Based On A Condition

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

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 14 Replies View Related

Forms :: Disable Or Hide Button Based On Date Condition In MS Access

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

Queries :: Use Switch In Query Criteria Based On Combo Box

May 15, 2013

On I form I have a combo box called cboMobileStatus.Its row source type is "Value List".The row source is: 1;" All";2;"Has";3;"None".I have a query based on table "tblCustomerContacts" and I want to limit the records returned based on the value of the combo box.So if the user selects:

* All (1) I want all records returned.
* Has (2) I only want records that have a mobile number returned
* None (3) I only want records that do not have a mobile number returned

The field mobile is text (to keep the leading 0)I thought of using the Switch function in the criteria of the query for field Mobile like this:

Code:
Switch([Forms]![frmPrintCustomer]![cboMobileStatus]=1,([tblCustomerContacts].[Mobile]) Like "*",[Forms]![frmPrintCustomer]![cboMobileStatus]=2,([tblCustomerContacts].[Mobile]) Is Not Null,[Forms]![frmPrintCustomer]![cboMobileStatus]=3,([tblCustomerContacts].[Mobile]) Is Null)

but the query does not like it!Am I on the right track, and if so, how should I modify the code?

View 2 Replies View Related

Opening Subform Based On A Certain Condition

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

Queries :: Update Table Based On Condition?

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

Switch Forms But Same Record !?!

Jan 7, 2005

Here is an interesting one:



Have 2 forms, (1) Contact Information, and (2) Survey Response

Any Clues on how to set un a button to switch from Form to Form but stay on the same Record!!!! Interesting One!

Apriciate any help/clues/links =)

View 3 Replies View Related

Forms - Switch Between Records (Using VB)

Apr 3, 2006

Hi Guys,

You know on forms, you have those little Left and Right arrows (< >) at the bottom of the form, and you can click on them to switch between records... yeah?

Well, how can I make the form switch between records with VB. Lets say I want a VB script that jumps to the 5th record in the table, how would I do that? Normally you would just click the Left arrow 5 times... but I want to do it with code.

Thanks!

View 1 Replies View Related

Forms :: How To Switch To Correct Record When Switching Forms

May 7, 2013

I have a form called "Customer Details", on that form i have child forms, including one that has a schedule on.. so far everything seems fine, am able to get it to pull data correctly to the correct fields.. etc

I'm using 1 main table for all of this called "Cases"

Now the problem is, when i i click a button to print (this works so far), it opens another form and then fills in all the textbox's, however this is where i've got the problem, as it always seems to pull the data from the first record, not the record that i'm currently on..

so for example, if in the customer details, someone looks up "joe Blogs" using the navigation search and then wants to print it, by hitting the print button .. it should open another form, fill in the boxs and print "Joe Blogs", however it's always doing "Joe adams" - 1st Record

View 2 Replies View Related

Forms :: Switch Board Manipulation

Nov 18, 2013

I know that i was discussed a lot but now it's about accexx2010.

I need to have more than 8 items on my switchboard but can't find any code for that in VBA.

I'd rather not use the option of building a regular form as switchboard.

View 14 Replies View Related

Forms :: Toggle Switch On Header Of Form

Apr 14, 2015

I would like to create a command button on the header of a form. The button should perform a toggle switch: click once to activate the task and click it again returning original state. I can create the command button to perform a task but do not know how to return to original state. The button should have indicator showing which state is in.

View 2 Replies View Related

Forms :: Getting Error After Using Switch Board Wizard

Nov 2, 2014

I use the switchboard wizard to set up a switchboard. At the moment my main switchboard has 3 items and they are all set to 'open form in add mode' and they all point to the same form at the moment (which does exist).

When I try to go to form view of the switchboard I get the error 'The control name label1 is misspelled or refers to a control that doesn't exist'. Behind it I can see the form in form view and I can see there are the 3 menu items I would expect but when I close the error dialogue and the following 'close macros' dialogue' it goes back to design view. In design view I can only see one menu item (which seems to be a text box rather than a label) instead of 3. I changed it to a label but it didn't work.

View 1 Replies View Related

Forms :: Navigation Control And Switch Between Tabs

Jun 16, 2015

I'm using a navigation control with 3 tabs. I would like to open a specific tab after the user login. I tried this but it does not work:

NavigationControlName.Tabs.Item("tabNameToOpen").S etFocus

I have tried:

Me.NavigationSubForm.SourceObject = "FormName"

then the form change but the tab selection no!

View 14 Replies View Related

Forms :: Combobox And Textbox With Condition

May 4, 2014

It related training (Training topic and Training Date). I used combobox as training topic (fill with items 0 and 1. 0 for not train and 1 for trained). when user choose 0, cursor will go to another combo box (Other training topic), by Training Date is disable, but if user choose 1, cursor will working as normally let user to enter training date.

Problem : When I choose 0 in topic control in Form View and save, It works normally (Training Date is disable), but when I Open it in Form Design View and Open It to Form view that topic control become enabled.

View 3 Replies View Related

Forms :: How To Open Navigation Form Using If-then-Else Condition

Jul 29, 2013

I am pretty new to access so i am using a very basic function structure to open a navigation form using if-then-else condition, Below is my VB coding:

Option Compare Database
Private intLogonAttempts As Integer
Private Sub Emp_Exit_Click()
DoCmd.Quit
End Sub
Private Sub EmpLogin_Click()

[Code] ....

I am getting an run time error '2467': "The Expression you entered refers to an object that is closed or doesn't exist"...

View 14 Replies View Related

Forms :: Adding Additional Records On Condition

Jun 29, 2013

What I am trying to create is a Despatch database for our warehouse.

Records in table:
Date ()
Customer
Invoice #
Qty of parcels sent
Courier used
consignment number

In most cases we will send one invoice per consignment number (database works fine for this) But on occasion we may send multiple invoices. What I want to be able to do is have a list box to select the number of invoices, this will make available additional fields for Invoice # and Qty of parcels sent. The idea is to get away from keying in the other records for each invoice going to the same place.

View 3 Replies View Related

Forms :: Open Form With Where Condition - No Record Found

Apr 16, 2013

I try this code and it's not working

no record found

Code:
Private Sub openForm_but_Click()
Dim whr As String
whr = "get_date = #" & Me.gDate & "#"
DoCmd.OpenForm "searchResult_form", acNormal, "", whr, acFormPropertySettings, acDialog
End Sub

View 7 Replies View Related

Forms :: Label Text Show / Hide Condition With Check Box Value

Jul 24, 2013

I have a report base on my table. Here a check box. I wanna show two label text hide/show base on when check is true or false. It will be when report will be open. I have try this but nothing is happened.

Code:
If AffecteAc= True Then
affected.Visible = True
general.Visible = False
End If

View 1 Replies View Related

Forms :: Condition A Field To Locked On 1 Record Of Continuous Form Subfile

Jun 1, 2015

Access 2002 . Can I condition a field to 'locked' on just one record of a continuous form subfile, based on the contents of a 2nd field in same record?

View 14 Replies View Related

Switch Function

Mar 5, 2008

Hi All,

Some help from cyber space is what I need me thinks :confused:, I am using a switch function in an access query to convert 24 to 624 and 28 to 628 and so on for about 5 entires however there are numerous entries that might not meet my criteria that are errorrs can I just simply place in there a default option if the rest are not made like in a case statement.

I know somebody is going to suggestion placing this in a macor/function but would prefer to not have to do that if possible, but if I do I dot.

Any help greatly appreciated. Come on Cyber Space dont let me down! :D

Cheers,
Tempest
"Life is like a box of choclates you never know what your gonna get"

View 1 Replies View Related

Using Between Function Within Switch

Mar 23, 2014

I'm using the simple test expression below to assign a value of 1 to records with [saledate] between the two dates indicated in the code below and I'm just getting a null result. Can the between function not be used in this way?

Code:
Hughes Test: Switch([saledate] Between 1/1/2014 And 3/14/2014,1)

View 6 Replies View Related

Using Switch Functions In Expressions.

Oct 10, 2005

i'm trying to use a switch function in a query but i'm unfamiliar with the format a bit. here is what i'm trying to do...

switch([Radios]![Warranty] and [Radios]![HousingWarranty]=true,[Radios]![Change front housing]*(25/60*28), [[Radios]![Warranty] And [Radios]![PortableHousingWarranty]=true], [Radios]![MaterialsUsedPrice1])

basically first statement is condition second is execution. I need to add more but i'm getting an error from this much...if I was doing this in vb.net I would just do if, ifelse, ifelse, ifelse...but...

Thanks,

View 2 Replies View Related

Using Wildcard In Switch Function

Jan 26, 2007

I am trying to use a Switch expression as a column heading in a crosstab query to generate statistics for how much work is done per client (Requester). Each requester is referred to by acronym, so it may look like "DOD/OUSD/FTT/ATA/B", but I want that column to include everything that starts with DOD, instead of listing each instance separately. This is my expression so far:

Expr1: Switch([Requester]="DOD*","DOD",[Requester]="DS/ATA","ATAP")

When I run the query, the column "ATAP" shows up perfectly with all the correct info, but it's as if I never entered "DOD*". Nothing appears, and since I didn't add anything in the Switch function for what to do with other requesters, the second column shows up as <>.

Do wildcard *'s not work in Switch functions? I don't get any errors, but this is definitely not the information I'm looking for.

Is there any other way to include all Requesters that start with DOD in one column?

This is my SQl if that's helpful:
TRANSFORM Sum([Q and D Database].[Word Count]) AS [SumOfWord Count]
SELECT [Q and D Database].[Source/Target]
FROM [Q and D Database]
WHERE ((([Q and D Database].[Out Date]) Between #1/1/2006# And #12/31/2006#))
GROUP BY [Q and D Database].[Source/Target]
ORDER BY [Q and D Database].[Source/Target], Switch([Requester]="DOD*","DOD",[Requester]="DS/ATA","ATAP")
PIVOT Switch([Requester]="DOD*","DOD",[Requester]="DS/ATA","ATAP");

Thanks!!!

View 2 Replies View Related

Switch Function Problem

Jul 23, 2007

Hi guysI have a problem with filtering a query in criteria using either iff or switch builtin function. my codes look like thisLike Switch([Forms]![frmMain]![grpReq]=1,"SysReq*",[Forms]![frmMain]![grpReq]=2,"ACR*",[Forms]![frmMain]![grpReq]=3,"ACSR*",[Forms]![frmMain]![grpReq]=4, not like "SysReq*" or "ACS*")the function works fine except for value 4 highlighted in bold. The query just didnt return the result i want. I suspect its the switch function not liking to evaluate the "Not like" part. I dont know how to go around this as i can only base on the prefix, namely SysReq, ACR, ACSRThank you for your ideas...

View 8 Replies View Related

Switch Board Question

Aug 28, 2006

Greetings!

I wanted to have a switch board available to my users. On the switch board I wanted to have a combo box where the users have multiple choices. For example, if a hotel was offering choices. The choices could be:

Room Reservation
Conference Room Reservation
Catering
Dance Hall
Transportation
Local Guide Information

After they select one of the choices, I wanted to put command buttons on the side that would take them to a form specifically related to the choice they made. So, some of the command buttons might be:

Send an Inquiry
Call
Make an Online Reservation
View information only


I haven't seen any Switch board that has choices so I don't even know if this is possible. If so, I'm happy to try.

Meanwhile.... I've never done VBA or any type of programming. I'm a beginning Access user.

Thanks.
Surfette

View 7 Replies View Related







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