If (checkbox) = True, Add A Unstored Value To A Field?

Basically, i have several yes/ no boxes and i want to make a running cost sort if thing. If one box is ticked then Total cost will be £2 for example, and if you tick the next box then the cost will be £5. But if you untick the box the price will be taken away again.

Any help GREATLY appreciated!

Edit Nearly solved guys! Just have to keep at it!!! What i did was for each tick box create a text box and the put this in each text box's control source: IIf([NAME OF TICKBOX]=True,10,0) This then put 10 in the box if true and if false 0 i then changed the format of all the text boxes so that it displayed currency, Thus giving a price! I then created another textbox that allowed me to calculate the total of all the other text boxes (=[Text38]+[Text40]..). the next problem is that i have to store the value calculated into a field, but how can i do that?! (btw i appreciate that there muct be an easier way but i couldnt find it, suggestions greatly welcomed!!)


View Replies


How To Check Table To Set Checkbox On Field To True - Version: 2000 (9.0)

Code:If DLookup("[Note]", "[Note Info]", "[Soc Sec] = Forms![Apprentice Information]![Soc Sec #] AND [Note Info].[Note] aLike '%Adv%' AND [Note Info].[Eff Date] <> ''") Then
[attendance advisement].Value = True
[attendance advisement].Value = False
End IfI'm receiving a Data Type Mismatch in Criteria Expression in the form that this is linked to. [attendance advisement] is a checkbox on the form. Have I been going about this the wrong way or should I be concentrating on reworking the DLookup statement?

Essentially, I want to say "If (there is a note in the [Note Info] table where the Soc Sec is the same as it is in the main form and has the letters "Adv" in the note and it has an effective date that isn't empty) then set the checkbox on the form to true, otherwise set it to false.

View Replies View Related

Tick Checkbox If Database Is True

in my web page, i would like to user to see a ticked checkbox should the database = True however, i cannot seems to be getting it. Would anybody be able to help me out?

strSQL = "SELECT DeptHeadA FROM Employee WHERE EmpId = '" & strEmpId & "'"
nRecDHA = GetRecordset(strSQL, arrDHA)

if arrDHA(0,i) = True then
arrDHA(0,i) = "Checked"
arrDHA(0,i) = ""
end if

<TD valign=top width="27%"><font size="2"><b>Department Head Alternate (1st) :</b></font></TD>
<td width="72%">
<input type="checkbox" name="DeptHeadA" value="<%=arrDHA(0,i)%>"></td>

View Replies View Related

Set Checkbox To True In Word Document - Version: 2003 (11.0)

I have a checkbox in a word document. It's bookmarked as "checkbox1".
I opened this document in MS Access 2003. How do I set this checkbox to true/false in the database module?

View Replies View Related

If (checkbox) = True, The (textbox) = "Yes"

I want to add a textbox to my forms that either says "Yes" or "No" depending on what a non-visible checkbox is. My forms look funny with checkboxes all over the place (Yes or No fields). My reports would look better with "Yes" and "No" rather than checkboxes.

The question is, the control source of the new unbounded textboxes (or anything else for the matter), I don't know how to write the expression for it.

Can I just say...

if checkbox1=true then

I understand how to write these in the VBA builder. But in the expression builder...

View Replies View Related

Make Field True If Other Field Is Null

Is there an expression in a query, that if want to say, if one field is not null make another field say true?

View Replies View Related

Open Query If Field Is True

I have 3 queries that pull from 3 dfferent tables. All 3 tables contain a field called Acct but the other fields in the 3 tables are different. What I would like is to have a form field that the user can input an account number and depending on which query the account number is in, that query and result will display. I have been trying the dlookup function but can't seem to get the coding down. Also, if the account number is not in any query I would like a message box to display saying it can't be found. Thanks for any help!

View Replies View Related

Open Query If Field Is True

I have 3 queries that pull from 3 dfferent tables. All 3 tables contain a field called Acct but the other fields in the 3 tables are different. What I would like is to have a form field that the user can input an account number and depending on which query the account number is in, that query and result will display. I have been trying the dlookup function but can't seem to get the coding down. Also, if the account number is not in any query I would like a message box to display saying it can't be found. Thanks for any help!

View Replies View Related

Open Query If Field Is True

I have 3 queries that pull from 3 dfferent tables. All 3 tables contain a field called Acct but the other fields in the 3 tables are different. What I would like is to have a form field that the user can input an account number and depending on which query the account number is in, that query and result will display. I have been trying the dlookup function but can't seem to get the coding down. Also, if the account number is not in any query I would like a message box to display saying it can't be found. Thanks for any help!

View Replies View Related

Query Criteria True/false Field

I'm trying to limit the records on a subform via an option group selection. The group has 2 options: optionTrue (option value = 1) and optionFalse (optio value = 2). I have the following code in my query criteria of the true/false field.


The false part works, but the true part doesn't. I've tried many variations using true/false, using checkboxes, etc. and nothing works.

The database is SQL Server if that matters.

Any suggestions?

Also, is their a way to have an option for True or False or ALL?


View Replies View Related

Setting Table Field To True When Exporting To Csv


I export a query as csv to upload to another database on a web site. When that csv file has been exported I'd like the query to be emptied, so that the next time I export I don't export duplicates. What's the easiest way to do that?

I've been thinking of having a field in the table with a check box that is checked when the file is exported. The query then selects only those records where that box is not checked.

But how can I check those boxes on Export rather than when I run the query? The reason being that I may want to preview by running the query, without having that affecting the check box.

View Replies View Related

Update Field In One Table When Data True In Another - Version: 2002 (10.0) XP


I have two tables, one which has details about members and their financial status and another which holds details of their membership payments.

Normally my user access these tables through the form - Main which hold People data, then they open a subform to add in their payment details.

What I would like to be able to do, is when a payment is added for that user to the payment table (which has a value greater than $1.00 in case the button is pushed in error), then the Financial status in the table holding data from the Main form is updated to Financial. I am not sure where to start>

Thanks for your help


View Replies View Related

Is This Possible? - Update A True/false Field Using Listbox - Version: 2003 (11.0)

Hi experts, I'm hoping you can help me with this.. I have recently found out how to use the INSERT INTO statement to add multiple records from a listbox to a table, I now need to UPDATE records in another table using a multi-select listbox.


I want to present a template of working hours of staff by showing 48 x 30minute intervals, each as a row in a listbox. My idea is that if the person usually works 9am till 5pm, there is a yes / no in the relevant field in the table. I then want the working hours to be modified in the form of a listbox where when loaded it shows the 9-5 rows selected, and it can be modified by selecting more rows / deselecting rows, then saved and the table updated.

...I know how to do it with check / option boxes and i'm sure it can be done with multiselect list boxes but I just don't know how?

Hope you can help, OllyJ

View Replies View Related

Display Checkbox Value In Another Field

Hello everyone, I have some experience with access but am having difficulty at the moment with a command. This is what I am wanting to do;

I have some checkboxes which when checked I want a separate field to display a number. i.e. When 'Taster' is checked 'Overall Price' will show '225' but also when 'Meal' is checked 'Overall Price' shows '500'.

Can anyone walk me through this please?



View Replies View Related

Using A Checkbox To Restrict A Field

hi all

i have created a form to enter details into a 'job' table.

here is the part of the form my question deals with.

FIELD- Terminal DATATYPE - Lookup wizard (the values 1-5 stored in a separate terminal table)

basically the system involves entering minicab jobs into the database.
the job may or may not be at the airport.


if the airport checkbox is ticked (Yes), then the terminal value can be set (1-5) from the form.
if the airport checkbox is unticked (No), then the terminal value cannot be changed from the form.

if this can be done, how can it be done? anyone..??

View Replies View Related

Checkbox To Enter A Value To Field

Hello, I want to add a checkbox in my form which will update or enter a value to a field. To explain more better the form is access of application so the question will be does the user have Network Account. if the check box is checked then it should add a value to its own field or another field in the same table Network Account. If its not checked then the field should be blank. The way i am doing is i created a check box field and then there is seperate field hiden or in front of checkbox. The control source i put is iif([checkbox1]=-1,"Network",ISnull) this way i get the value in form field but its not linked anyway to table field.

Is there any easy way to populate a field i will be having couple of checkbox like this.

Thanks for your help

View Replies View Related

Checkbox Activates Field

I'm fairly new to Access and have a question. I've been able to set up a decent database (my first) but am looking if certain Form functionality is available. I have a checkbox that is checked when a certain criteria is met. When that's checked, there's additional data that I need to enter. Is there a way to make those additional data fields either disabled or not visible at all until the checkbox is a yes? I appreciate your help!!!

View Replies View Related

Can I Use Checkbox To Trigger Field Input?

Here is what i want to do:

I have a main order form with a subform for order datails (products, quantity, extended price, etc..). The default way of calculating a selling price is by using the cost plus a profit margin (the margin is a percentage defined on the main form)

But sometimes we want to define the selling price differently, bu using the List price instead, on which I can apply a discount. So what I did is put a checkbox field on my subform, and when the checkbox is "true" the selling price is now the list price field from the products table instead of the "cost plus" calculated field.

So far everything works perfectly as described. The only that I am now left to do is to be able to "ask" for the desired discount when the checkbox is selected. What I mean is that when the checkbox is clicked (true), I would like for a dialog box to pop-up and ask for the discount that should be applied to that record in the subform...Is there a way to do that with a "msgbox" or should I make a small form with only one field on it?...

The main reason why I want to do it this way is that I dont want to put the "discount" field on my subform as it would be on every item line and it is used only rarely because 90% of the pricing are bases on "cost plus".

View Replies View Related

Creating SalesTax Field Based On Checkbox

In my checkbox named Taxable I have the following in the afterupdate

Private Sub Taxable_AfterUpdate()
If Me.[Taxable] = True Then
Me.[Tax] = 0.06
Me.[Tax] = 0
End If
End Sub

This will only insert whole numbers in the Tax field as I have tried several
combinations of numbers. How can I get Tax = 0.06?

View Replies View Related

Creating A Checkbox Field Through A Make-table Query

Hello to everyone,

I have a colleague who executes a make-table query that reads a txt file. While doind this, he wants to convert two columns (binary format) to checkboxes (Yes/No format). Is there a way to do that?

Thanx in advance

View Replies View Related

Sync CheckBox To Update/Write To Text Field

Hey Guys,

I'm looking to create a "Same As Billing Address" check box that would automatically udpate the address in an order to reflect the customer's billing address.

I understand how to sync a combo box to an option group ( -- great article by the way)

I Guess what I'm looking to do is:

1. Sync a "Same As" Checkbox to multiple text boxes in the form (Unit, StreetAddress, City, Province, Postal) such that these fields are UPDATED (writen to) with the same information as the billing address

2. [U]IF the "Same As" Option is selected, I need the updated fields to lock, allowing no further update... but must by unlocked if the "Same As" option is NOT selected.

Please help me out with this one guys.. I really need it.

View Replies View Related

Input Current Date Into A Field By Clicking Checkbox

Does anyone know how to automatically enter the current date into a specified field by simply clicking on a check box. I imagine the IIf function would work when entered into 'Control Source' but I also need the check box to be linked to the underlying table.
i.e. I tick the 'Paid' checkbox and the current date is automatically entered into the 'Date Sold' field. I also need the -1 generated by clicking on the checkbox to be stored in the table.

Any suggestions would be appreciated, although I am no good with code, so if you could post an example or an easier way to do it I would be most grateful

View Replies View Related

Binding A Checkbox To A Field In A Table - Version: 2000 (9.0)

Is there a way to do this?

I have a form with 97 checkboxes associated to 97 questions. I also have a table called "Questions" with the following fields (QuestionID, Question, Answer). "The Answer" field has 97 checkboxes. I want to bind the form checkboxes to the field checkboxes so when they are checked on the form, they also appear as checked in the field.


View Replies View Related

Unlink Label And Checkbox On Yes/no Field - Version: 2003 (11.0)

An underlying field my report is based on is called FF_Paid, and is a Yes/No field type. I am grouping (primary) on this field in my report, and when I dragged the field from my field list, it set up a label and a checkbox.

Everything works perfectly, but I can't hide the darned checkbox - if I try to set it's properties to Visible=no, it hides the corresponding label - is there a way without using code I can "unlink" the label and it's corresponding checkbox ?

View Replies View Related

Form Field Validation - "Cancel = True" Problem

I'm calling this code on my Form's BeforeUpdate Event which I understand should only run if the form is dirty. In this example, the code should check to see if 4 fields ("txtField1", "txtField2", txtField3", "txtField4") have data present, if not highlight them yellow.

Function Msg()
Dim ctl As Control
Dim strFields As String
Dim strControl As String
Dim intCounter As Integer
Dim blnEmpty As Boolean

For Each ctl In Me.Controls
blnEmpty = False
If ctl.ControlType = acComboBox Or acTextBox Then
If ctl.Visible And Len(ctl.Tag) > 0 Then
Select Case ctl.Tag
Case "txtField1", "txtField2", txtField3", "txtField4"
If IsNull(ctl.Value) Then
blnEmpty = True
ctl.BackColor = vbYellow
ctl.BackColor = vbWhite
End If
Case Else
If ctl.Value = 0 Then
blnEmpty = True
ctl.BackColor = vbYellow
ctl.BackColor = vbWhite
End If
End Select
If blnEmpty Then _
strFields = strFields & ctl.Tag & vbCrLf
If blnEmpty Then _
If Len(strControl) = 0 Then _
strControl = ctl.Name
End If
End If

If Len(strFields) > 0 Then
Cancel = True
MsgBox "You have not completed all data fields, " & _
"please enter data in the following fields:" & vbCrLf & strFields, _
vbExclamation, Me.Caption
Me(strControl).BackColor = vbWhite
Exit Function
End If
End Function

However, it keeps falling over at:
Cancel = True saying "Compile Error: Variable Not Defined"

I want to be able to run this code from a "Close Form button" to ensure that either the record is not created unless the fields listed are filled in or the form closure is cancelled so that the user can complete the missing data.

I've seen varients of this code on a couple of Access forums but can't find a solution for the "Cancel = True" issue.

Am I doing something wrong?

View Replies View Related

Sort A Continuous Records Form By A Checkbox Field ? - Version: Any Version

Hi All,

First post on the weekend....I need to get a life...

Anyway, I have a continuous records form with a checkbox field that the user will use to tag records for actions to be taken later. A subform in the form footer totals only the tagged records. Since there are many more records in the form than can be seen at one time I want to user to be able to sort the form based on the checkbox field so that they can easily see what records they've tagged.

I don't want to use a filter because I don't want to hide, even if only temporarily, records from the user. I also don't want to tell the user to just click in the checkbox and then click the native sorting buttons in the toolbar because when you click into the checkbox field it automatically changes the value of the field and I'm afraid the user will mistakenly tag/untag a file by using this method.

I had wanted to use a toggle button so that when you clicked once it would sort ascending and twice for descending...

Your thoughts ?

View Replies View Related

Tabbing Checkbox To Checkbox

I have a form with a rather long subform. The subform has various data entry controls. Tabbing through the subform works fine unless focus leaves a checkbox and is set to another. When that happens, the subform is repositioned to the top (kind of like it's been requeried). The user then has to scroll back to where the focus is. Any ideas on how to remedy this?

View Replies View Related

If A Is True, Then Do B


The above formula works as is in the field I have it in, but need it performed only if [Label5] is marked yes. I guess what I need is what goes in front of the above formula. I've looked through the forum, but it is so huge I had no luck finding what I needed.

If [Label5] is no, I need it to go to [Label6] and if [Label6] is yes, perform another calc like the one above. If [Lable6] is no, I need an error message.

Hope this is clear. Any help is greatly appreciated.


View Replies View Related

Allowaddition = True

Hi all very simple question i'm sure but had a look through the forums and couldn't find anything.

On a form i have 2 buttons, one for new data and one for editing data. When either of these buttons are clicked a few text boxes pop up and immediately display data (The first record of the recordset). For the edit button this fine, however how do i get the text boxes to display a new record and not allow the user to head backwards through the recordset only onto a new record??

Thanks in advance

View Replies View Related

Posting A Pic When A Value = True

Hi everyone,

I have made a form for our database and I would like to have a .gif image display when a certain checkbox is checked. Any idea how to do this?


PS - sorry if this is a noob question...I don't use access much

View Replies View Related

Locked=True Fuzzy

I have a form that has code tied to the 'on open' event that is going to be accessed by users where we want them to only have access to certain fields which we want them to fill out. The fileds that will be locked will change based on the field called 'Item Number'. The code will be long because there are 30 different Item Numbers and about 10 to 20 fields that we will disable based on the Item Number. The code is like:

Dim Item_Number As String
If Me.Item_Number = "32000" Then
Me.Batch_Lot_Number.Enabled = False
End If

This is all great except that the disable makes the field kind of obscure by the color it gives it. I don't want to use the lock property because that doesn't give you a visual clue that its locked.

Is there a way to change the color of the field background using VBA?

View Replies View Related

Iif With True Part Containing 2 Values

First Post - please be gentle :)

I may be missing something here, but can any one help?

I am using a Iif statment in a query to filter records as follows:

If([value from a form]= "all holidays",("weeks hols" or "days hols"),"not a holiday")

This is returning a to complex to calculate error - I think it is a Syntax error but could be wrong
but if I enter The string "week hols" or "days Hol" as the criteria without the Iif statment that works fine.

Thanks Dean

View Replies View Related

Counting True Items

Can anyone help?
I have a table with the following:
Booked with a y/n field
Person Name with a text field
Yes(True) Jim
Yes(True) Jim
No(False) Jim

What I need is to be able to show a query that shows if the checkbox is ticked (True) and the Name is Jim total up how many true items there are. So from the above I can see that Jim has 2 true items. I would then like this shown in a text box is this possible?
Also, it is not always going to be a person called Jim so... (From above)
Yes(True) Jim
Yes(True) Jim
No(False) Jim
Yes(True) Jack

So how would this go on a query in a sub form? So Name Jim would show 2 and Jack would show 1? At the moment is is grouping the name and I dont want that.
Any ideas

View Replies View Related

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