Using A Checkbox To Return Text Based On Another Textbox
Apr 26, 2005
Dear All:
I have a form with three items:a checkbox called "Check231", a textbox called "text921" and another textbox called "text762".
What I wish to do is: Enter text in textbox921, which stays the same as I scroll through each record. Then If checkbox check231 is checked, it displays text from textbox921 to textbox762. Textbox762 is bounded to the form.
I have 44 checkboxes, each has a textbox next to it. What I want is when the user selects a checkbox, the textbox next to it will be enabled. Also, when the user unselect a checkbox, the textbox next to it will be disabled and any value entered is cleared.
Another way is whenever the user enters a value in a textbox, the checkbox associate with it is selected and vice versa.
Thank you for all you help with the above title. Your suggestions were all implemented.
Code: Private Sub GPA_AfterUpdate() If DIVISION = GRADUATE Then 'Honors field is empty HONORS = "" End If If UNDERGRADUATE = True Then 'Apply appropriate honors End If If GPA < 3.2 Then HONORS = "" ElseIf GPA >= 3.2 And GPA < 3.5 Then HONORS = "CUM LAUDE" ElseIf GPA >= 3.5 And GPA < 3.8 Then HONORS = "MAGNA CUM LAUDE" ElseIf GPA >= 3.8 Then HONORS = "SUMMA CUM LAUDE" End If End Sub
Here is the issue: Form created with with a combo box called "DIVISION."The choices of the combo box are "GRADUATE" AND "UNDERGRADUATE." There is a text box called "GPA", where a gpa is entered. then, there is an "Honors" field. When a gpa is entered, the honors box returns the appropriate message.
When graduate is selected from the combobox, the honors box should be empty. (That part does not work.) When undergraduate is selected from the combo box, it works.
I have created a form based on a query with students' gpa in the form. The gpa is in a specific field. There is another field for honors with is for summa cum laude, magna cum laude, cum laude.
Here is the issue: If the students' gpa is 3.8, return "summa cum laude" If the students' gpa is 3.5, return "magna cum laude" if the students' gpa is 3.2, return "cum laude"
This applies to undergraduate students only, which there is a field for.
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
I have created a text field on a form that uses the DateSerial function to return the value of last month e.g. Jul-06.
I have a table that contains months (e.g. Jul-06, Jun-06 etc) and a corresponding numeric value (e.g. 1,2,3).
I have another text box on the same form that I want to display the numeric value in based on the value that has been returned by the DateSerialfunction. What properties/control source should I set for this field? Or do I need to write some VBA?
New to Access... With the following code, the checkbox works, yet in the form when you check the checkbox...all the other boxes are checked as well. 1. Checking the box return the date 2. UNchecking the box does not clear the date but it unchecks all of the boxes on the form list.
-------------- Private Sub Check30_AfterUpdate() If [Check30] = True Then [DATE_PAID] = Now() Else End If End Sub -------------- Suggestions?
I have a checkbox that when checked returns all of the yes values for the column but I want it so that when it isn't checked, it doesnt search for this criteria at all, is there a way of doing this? I tried option buttons too but I wasn't sure of how to go about it.
I'm guessing that this will take coding and I don't know coding very well. I have 4 categories...I'll call them A B C D. For each category, there is 3 text boxes, EX: A Cost, A Refund, A Rec Date I will have a checkbox for when each is rec. but not all accounts will have every category(A, B, C, D). I'm trying to get the checkboxes for each category to be disabled if and only if the Category(A, B, C, D) Cost is NULL or 0.
I've searched the forum for my problem and the closest i got was this and it doesn't help that much
If this is the code you can put on click for a checkbox to hide a textbox. If me.YourBoosterCheckBoxName = -1 then 'need the shot so hide the other textboxes me.TextBox1.visible = false me.TextBox2.visible = false 'etc.... else end if
How do you make a code for a checkbox to SHOW a textbox?
I have a text box on a form, currently it performs a dlookup for me. I want to change it so that it only performs the Dlookup if a checkbox is checked, but otherwise will display the text that's in an unbound text box.
Not 100% this is even possible, but hoping so. So far I have in the textbook:
The dlookup works fine by itself, it's just making it conditional that's causing me problems. I know it could just be a small problem with the way I've written it, or it could be a bigger thing with me not understanding the way IIF works.
My bound master form has bound subform in it and both of them has linked fields. In the master form i've placed a checkbox which if unchacked will lock and disable a textbox in the SUBFORM, and if checked will enable and unlock the textbox and fill it with a calculation result, which will then be passed on to the underlying table.
Now, suppose in the master form (named X), i have A (checkbox) and B (textbox with numeric value) and in the subform (named Y), i have C & D (both textboxes with numeric values). Hence if A is checked, I'd like D to return the result of - "B*C". Or else D will remain locked and disabled.
I have a textbox on a subform and I want to get the sum in a string as follows.
Code: Dim s1 As String s1 = Sum(Forms!CountItem!CountItemLastCount.Form!ThisCount) MsgBox s1
When I use the above I get an error message saying - Sub or function not defined and it highlights the sum part of the equation.
I have been using the sum criteria in a textbox but if the user doesn't tab of the box then it doesn't see it as being updated.
I have tried me.dirty and everything else that usually works like send keys tab event, requery form and controls, a left mouse click but nothing is working, therefore I thought that code to actually update the textbox may work.
I have a Mainform [FrmReconcileMain] and it contains a Subform [FrmReconcilesub]
What I'm trying to is, on the Main form type in a statement date in textbox [TxtStatementDate].
I have a checkbox on my subform [ReconciledYN], along with a textbox [TxtReconcileDateSub]. when I click the checkbox, it simply pulls the date from the mainform and populates the date in the subform.
I've even tried experimenting on a simple form (with no subform) to see whats going on, but still I can't get it to work, even on a simple event such as this...
If [yourcheckboxname] = -1 Then [controlnametoupdate] = date() Else [controlnametoupdate] = ""
I have created a form using access 2000. So far, this form already has data and dates in a combox in this format: mm/dd/yyyy.
In the AfterUpdate of the date combobox, I did this:
If graduation_date = #2/1/2004# then Text_Graduation_date = "dated this first day of february two thousand four." End If End Sub
In addition, I have defined many other dates as well using the code above. It works well when I choose the date form the combobox, the other textbox populates, but there are so many more dates in the combo!
Is there a way to auto-populate the textbox with the appropriate text as I scroll through the form?
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
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?
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.
I am having a problem with making a textbox visible on a form if a checkbox is checked on the same form. I have done research on this site and have written the code below, but I am getting a Syntax error, see yellow highlight.
- My checkbox is named: Case is a Readmission from WRCA IP to WRCA IP - My textbox is named: Date of Current IP Admission (I have defaulted this textbox to not visible).
Here's the code I have written:
Private Sub Case_is_a_Readmission_from_WRCA_IP_to_WRCA_IP_Clic k() If Case is a Readmission from WRCA IP to WRCA IP =true then Date of Current IP Admission.visible=true Else Date of Current IP Admission.visible=false
I have a form with a subform inside of it. On the subform I have created a field for a check box. I wish for the user to be able to click 1 or more check boxes in the subform and then click a delete button that removes all selected entries.
I have this code from a seperate post regarding this problem, but am not sure how to edit it to reflect what I need.
Sub DeleteRecordButton_Click()
'Delete the selected record dim strSQL as String strSQL = "DELETE * FROM mytable WHERE mytblID = " & Me![mySubForm].Form![mytblID]
I have a form with one checkbox on at the moment. Depending on whether it is checked or not I want to choose to display or not display a field on a form.
I have the following code below but whether the checkbox is ticked or not it doesn't affect the report.
If Check4 = True Then [Report_Temp].Medium.Visible = False DoCmd.OpenReport "Temp", acViewPreview, , MyFilter