If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Value extract a value
I have a couple of issues:
1) I'm trying to get a checkbox to become checked if certain values are entered. For instance, if my "date" text box has any value, I'd like the checkbox to become checked. I'm assuming I will have to extract the value from the field for the individual record, but I'm not sure how to do this. 2)Is there a good way to update this upon value changes? Right now I'm setting this to update whenever the mouse is moved on the form. Thanks! |
#2
|
|||
|
|||
Value extract a value
Andy,
If I understand what you want correctly, I would say you need to put some code on the After Update event of the "date" textbox, something the equivalent of this... Me.NameOfYourCheckbox = Not IsNull(Me.NameOfYourDateTextbox) It's a puzzle, though, what the purpose of this would be. I mean, if the date box is empty, you can see that it's empty, without needing a checkbox to tell you so? Or have I meesed the point? -- Steve Schapel, Microsoft Access MVP AndyM wrote: I have a couple of issues: 1) I'm trying to get a checkbox to become checked if certain values are entered. For instance, if my "date" text box has any value, I'd like the checkbox to become checked. I'm assuming I will have to extract the value from the field for the individual record, but I'm not sure how to do this. 2)Is there a good way to update this upon value changes? Right now I'm setting this to update whenever the mouse is moved on the form. Thanks! |
#3
|
|||
|
|||
Value extract a value
Steve and John,
Thanks for your help. The purpose of the checkbox is to be checked if multiple conditions apply. For one, the date box must have an entry, I also have a "Stress" text box which, if left null or changed to "inbox", to allow the checkbox to become checked, otherwise I need the checkbox to become unchecked. In the end, I want to develop a filter that will only bring up records that have the checkbox checked. I imagine I wil have to do this through a series of if statements. Does that seem right? Thanks Again Andy "Steve Schapel" wrote: Andy, If I understand what you want correctly, I would say you need to put some code on the After Update event of the "date" textbox, something the equivalent of this... Me.NameOfYourCheckbox = Not IsNull(Me.NameOfYourDateTextbox) It's a puzzle, though, what the purpose of this would be. I mean, if the date box is empty, you can see that it's empty, without needing a checkbox to tell you so? Or have I meesed the point? -- Steve Schapel, Microsoft Access MVP AndyM wrote: I have a couple of issues: 1) I'm trying to get a checkbox to become checked if certain values are entered. For instance, if my "date" text box has any value, I'd like the checkbox to become checked. I'm assuming I will have to extract the value from the field for the individual record, but I'm not sure how to do this. 2)Is there a good way to update this upon value changes? Right now I'm setting this to update whenever the mouse is moved on the form. Thanks! |
#4
|
|||
|
|||
Value extract a value
On Fri, 3 Mar 2006 06:54:27 -0800, AndyM
wrote: Steve and John, Thanks for your help. The purpose of the checkbox is to be checked if multiple conditions apply. For one, the date box must have an entry, I also have a "Stress" text box which, if left null or changed to "inbox", to allow the checkbox to become checked, otherwise I need the checkbox to become unchecked. In the end, I want to develop a filter that will only bring up records that have the checkbox checked. I imagine I wil have to do this through a series of if statements. Does that seem right? Yep. Sounds like you might want to write a custom VBA function which goes through the logic tree; something like Private Function ShowCheck(vDate As Variant, vStress As Variant, other possible arguments) As Boolean If IsNull(vDate) Then do something appropriate .... End Function In the function you would set ShowCheck to True or False appropriately. On the Form you'ld set a checkbox control's Control Source to =ShowCheck([txtDate], [txtStress], [ThisControl], [ThatControl]) to automatically display the appropriate check. John W. Vinson[MVP] |
#5
|
|||
|
|||
Value extract a value
Thanks a ton- you've been very helpful.
--andy "John Vinson" wrote: On Fri, 3 Mar 2006 06:54:27 -0800, AndyM wrote: Steve and John, Thanks for your help. The purpose of the checkbox is to be checked if multiple conditions apply. For one, the date box must have an entry, I also have a "Stress" text box which, if left null or changed to "inbox", to allow the checkbox to become checked, otherwise I need the checkbox to become unchecked. In the end, I want to develop a filter that will only bring up records that have the checkbox checked. I imagine I wil have to do this through a series of if statements. Does that seem right? Yep. Sounds like you might want to write a custom VBA function which goes through the logic tree; something like Private Function ShowCheck(vDate As Variant, vStress As Variant, other possible arguments) As Boolean If IsNull(vDate) Then do something appropriate .... End Function In the function you would set ShowCheck to True or False appropriately. On the Form you'ld set a checkbox control's Control Source to =ShowCheck([txtDate], [txtStress], [ThisControl], [ThatControl]) to automatically display the appropriate check. John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
a tip about how to extract .SWFfile from PowerPoint file | SusanZheng | Powerpoint | 1 | November 3rd, 2005 03:58 AM |
Extract records with a specific field appearing more than once in the DB | markx | Running & Setting Up Queries | 7 | September 28th, 2005 06:44 PM |
Trendline Extract | Phil Hageman | Charts and Charting | 5 | July 6th, 2005 02:27 AM |
Extract Unique Values, Then Extract Again to Remove Suffixes | Karl Burrows | General Discussion | 23 | June 25th, 2005 10:37 PM |
Extract specific data into its own workbook via macro? | Adrian B | General Discussion | 2 | February 24th, 2005 06:09 AM |