Hi.
My form contains a control (cboFooBar), which has an underlying field
with the "Required" property set to "Yes". Now, while filling out all
the controls of the form, I have to fill out this particular (required)
control as well.
However further down the form, there is another control, which has to
(under certain conditions) to delete again the content of the (required)
control just filled out before (cboFooBar). This is done by code.
However here comes the problem ... I cannot use "Me!cboFooBar.Value =
Null" since the "Required" property is set to "Yes". Access gives the
corresponding error message (logical!).
Now comes the question ... how can I delete a field, which has the
"Required" property set to "Yes".
TIA
--
Georges 16 8432
I'd turn the required status of that field off, and control the value of
that field programatically..
on myfield_exit() ' or maybe afterupdate..
if isnull(myform!myfield) then
myform!myfield = "defaultvalue"
end if
"Georges Heinesch" <vo**@void.com> wrote in message
news:40**********@news.vo.lu... Hi.
My form contains a control (cboFooBar), which has an underlying field with the "Required" property set to "Yes". Now, while filling out all the controls of the form, I have to fill out this particular (required) control as well.
However further down the form, there is another control, which has to (under certain conditions) to delete again the content of the (required) control just filled out before (cboFooBar). This is done by code.
However here comes the problem ... I cannot use "Me!cboFooBar.Value = Null" since the "Required" property is set to "Yes". Access gives the corresponding error message (logical!).
Now comes the question ... how can I delete a field, which has the "Required" property set to "Yes".
TIA
-- Georges
dp wrote: I'd turn the required status of that field off, and control the value of that field programatically..
on myfield_exit() ' or maybe afterupdate.. if isnull(myform!myfield) then myform!myfield = "defaultvalue" end if
Is there no solution using code while leaving the required status on?
--
Georges
> Is there no solution using code while leaving the required status on?
What value is the Required property if it isn't enforced?
--
Bruce M. Thompson, Microsoft Access MVP bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access) NO Email Please. Keep all communications
within the newsgroups so that all might benefit.<<
On Wed, 18 Feb 2004 22:24:02 +0100, Georges Heinesch wrote: dp wrote:
I'd turn the required status of that field off, and control the value of that field programatically..
on myfield_exit() ' or maybe afterupdate.. if isnull(myform!myfield) then myform!myfield = "defaultvalue" end if
Is there no solution using code while leaving the required status on?
It can be done as long as you don't try to leave the record.
--
Mike Storr www.veraccess.com
Bruce M. Thompson wrote: Is there no solution using code while leaving the required status on?
What value is the Required property if it isn't enforced?
Sorry, I don't get your question.
Could you rephrase please.
Thanks.
--
Georges
Georges Heinesch <vo**@void.com> wrote in message news:<40**********@news.vo.lu>... Bruce M. Thompson wrote:
Is there no solution using code while leaving the required status on?
What value is the Required property if it isn't enforced?
Sorry, I don't get your question. Could you rephrase please.
'Required' means that you're not allowed to put a null in that field.
So... if you want nulls in that field, why set it to 'Required' at
all?
> >>Is there no solution using code while leaving the required status on? What value is the Required property if it isn't enforced?
Sorry, I don't get your question. Could you rephrase please.
From Access Help:
"The Required property is enforced at the table level by the Microsoft Jet
database engine. If you set this property to Yes, the field must receive or
already contain a value when it has the focus - when a user enters data in a
table (or in a form or datasheet based on the table), when a macro or Visual
Basic sets the value of the field, or when data is imported into the table."
In other words, if the "Required" property for a field at the table level is set
to "Yes", the jet database engine will refuse to save a record that is missing
data in that field ... period. If the record were allowed to be saved, then the
"Required" property would be of little consequence - it's there to prevent null
values in the related field.
--
Bruce M. Thompson, Microsoft Access MVP bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access) NO Email Please. Keep all communications
within the newsgroups so that all might benefit.<<
Georges Heinesch wrote: Hi.
My form contains a control (cboFooBar), which has an underlying field with the "Required" property set to "Yes". Now, while filling out all the controls of the form, I have to fill out this particular (required) control as well.
However further down the form, there is another control, which has to (under certain conditions) to delete again the content of the (required) control just filled out before (cboFooBar). This is done by code.
However here comes the problem ... I cannot use "Me!cboFooBar.Value = Null" since the "Required" property is set to "Yes". Access gives the corresponding error message (logical!).
Now comes the question ... how can I delete a field, which has the "Required" property set to "Yes".
TIA
If that other field has this special value allowing the Null int FooBar,
is it still possible to have a value at all there? I mean, you can just
leave the value in FooBar since the signalling value in the other field
is present. Querying and reporting can filter on that.
--
Bas Cost Budde http://www.heuveltop.org/BasCB
but the domain is nl
phobos wrote: 'Required' means that you're not allowed to put a null in that field. So... if you want nulls in that field, why set it to 'Required' at all?
.... to temporarily delete the content of the control to make it visible
for the user that this field still requires input.
--
Georges
Bruce M. Thompson wrote: From Access Help:
"The Required property is enforced at the table level by the Microsoft Jet database engine. If you set this property to Yes, the field must receive or already contain a value when it has the focus - when a user enters data in a table (or in a form or datasheet based on the table), when a macro or Visual Basic sets the value of the field, or when data is imported into the table."
In other words, if the "Required" property for a field at the table level is set to "Yes", the jet database engine will refuse to save a record that is missing data in that field ... period. If the record were allowed to be saved, then the "Required" property would be of little consequence - it's there to prevent null values in the related field.
I don't want to save the record with Null in this field, I only would
like to temporarily delete the field in order to emphasize to the user
the empty field (make it visually more obvious). Sure, before the record
is saved, this value needs to be set.
--
Georges
Can't be done, Georges. The Required rule is enforced as soon as the value
of the control is changed, JET doesn't wait until you try to save the
record. If the Required property is True, you can not assign a Null value to
that field. You will need to either a) change the Required property to
False, b) find another way of indicating to the user that they need to
change the value or c) use an unbound control, and assign the value to the
field programmatically only when the record is saved.
--
Brendan Reynolds
"Georges Heinesch" <vo**@void.com> wrote in message
news:40********@news.vo.lu... Bruce M. Thompson wrote:
From Access Help:
"The Required property is enforced at the table level by the Microsoft
Jet database engine. If you set this property to Yes, the field must receive
or already contain a value when it has the focus - when a user enters data
in a table (or in a form or datasheet based on the table), when a macro or
Visual Basic sets the value of the field, or when data is imported into the
table." In other words, if the "Required" property for a field at the table
level is set to "Yes", the jet database engine will refuse to save a record that is
missing data in that field ... period. If the record were allowed to be saved,
then the "Required" property would be of little consequence - it's there to
prevent null values in the related field.
I don't want to save the record with Null in this field, I only would like to temporarily delete the field in order to emphasize to the user the empty field (make it visually more obvious). Sure, before the record is saved, this value needs to be set.
-- Georges
Georges Heinesch wrote: phobos wrote:
'Required' means that you're not allowed to put a null in that field. So... if you want nulls in that field, why set it to 'Required' at all?
... to temporarily delete the content of the control to make it visible for the user that this field still requires input.
Aah. Then what about a SetFocus (back) on the Exit event, unless the
value makes sense?
--
Bas Cost Budde http://www.heuveltop.org/BasCB
but the domain is nl
Brendan Reynolds wrote: Can't be done, Georges. The Required rule is enforced as soon as the value of the control is changed, JET doesn't wait until you try to save the record. If the Required property is True, you can not assign a Null value to that field. You will need to either a) change the Required property to False, b) find another way of indicating to the user that they need to change the value or c) use an unbound control, and assign the value to the field programmatically only when the record is saved.
a) not possible due to User Security features enabled.
b) possible with background color, however not in line with the
intuitive behaviour of the rest of the forms.
c) an option! gonna give that one a try.
Thanks a lot!
--
Georges
Bas Cost Budde wrote: ... to temporarily delete the content of the control to make it visible for the user that this field still requires input.
Aah. Then what about a SetFocus (back) on the Exit event, unless the value makes sense?
Not sure if I get what you mean ... is it that you suggest to leave the
required property off, and to check the value of the control using the
exit event? Sorry.
--
Georges
Georges Heinesch wrote: Bas Cost Budde wrote:
... to temporarily delete the content of the control to make it visible for the user that this field still requires input.
Aah. Then what about a SetFocus (back) on the Exit event, unless the value makes sense?
Not sure if I get what you mean ... is it that you suggest to leave the required property off, and to check the value of the control using the exit event? Sorry.
No problem, I'm very unclear at times.
I wasn't even thinking of a specific setting for Required, but
circumventing the Null in the first field. You don't have to set that to
Null if you can confine the user there until input is valid.
--
Bas Cost Budde http://www.heuveltop.org/BasCB
but the domain is nl
On Wed, 18 Feb 2004 20:41:17 +0100, Georges Heinesch <vo**@void.com> wrote: Hi.
My form contains a control (cboFooBar), which has an underlying field with the "Required" property set to "Yes". Now, while filling out all the controls of the form, I have to fill out this particular (required) control as well.
However further down the form, there is another control, which has to (under certain conditions) to delete again the content of the (required) control just filled out before (cboFooBar). This is done by code.
However here comes the problem ... I cannot use "Me!cboFooBar.Value = Null" since the "Required" property is set to "Yes". Access gives the corresponding error message (logical!).
Now comes the question ... how can I delete a field, which has the "Required" property set to "Yes".
TIA
I've been following this thread with interest because I recently had a similar
situation. I have basically a category/subcategory relationship on a form.
The category is not bound because it is simply used to filter the subcategory,
but if a subcategory is already chosen, and the user changes the category, I
want to null out the subcategory because it already appears to be null since
there's no longer a match in the subcategory combo's rowsource, and we don't
want to let the record get saved with the old subcategory ID value after a new
category has been chosen.
Basically, I found 3 possible solutions.
1. Make the control unbound. Set the control's value by copying from an
invisible bound control in the Form_Current handler, and don't update the
bound control from the unbound control until the Form_BeforeUpdate handler.
Of course, that's still a problem if there's some other save error, and the
user remains in edit mode.
2. Only display categories that have one or more subcategories, and
automatically pick the first subcategory when the category is chosen. This
might be slightly dangerous in terms of not forcing the user to explicitly
choose a subcategory, but it's not terrible. Also, some categories might have
only one category, and in this case, it's a nice, time-saving feature.
3. Cache all the control values, undo the record, and write back all the
values except the one that should now be null bending entry by the user. This
only helps on Add, not edit, and it's also in the "you must be joking"
category in terms of potential side effects, so that's a big no.
I think number 2 works out the best for my situation. Does this help in
yours? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: MrMike |
last post by:
Hi. I have a webform with a two required field validators. I have a cancel
button on the form which should allow the user to quit the form and
Response.Redirect to a previous webform. However,...
|
by: Orchid |
last post by:
Hello All,
Hope someone can help me on my required field problems.
I have a form base on a table for users to input new Employees. There
are 4 fields that cannot be Null when entering new...
|
by: Rick |
last post by:
I have an interesting problem when I run the following
code in Netscape (7.02) vs. IE. This page works great in
IE and all my controls bring up the validation summary
dialog box if the required...
|
by: Skeptical |
last post by:
Hello,
I have a form and two buttons on it. Button1 submits the data to a database
and RequiredFieldValidator is used to make sure all the required fields are
filled up, the second button has a...
|
by: Kivak Wolf |
last post by:
Hi,
Could someone give me a quick review of how to use the required field
Validator? I'm completely at a loss, and MSDN does not help one bit. =/
Basically all I want done is to make sure that...
|
by: dinsdale |
last post by:
Wow, this is a really embarassing thing to have to ask about...
I have an asp.net page with a multiview control in it. We want to enter
person info in a semi - wizard style and I wanted to use...
|
by: nimeshdotnet |
last post by:
Hi All,
I have a textbox whose readonly property is set to true. This textbox is also guarded by a required field validator. What i m doing that I have a calendar control whose on date selection i...
|
by: kiwipedia |
last post by:
Hi all
I have a combo-box control which I've set as a required field. It's a date and uses a calendar as coded below. All works fine unless the user deletes a pre-existing value (leaving a...
|
by: onseats.ky |
last post by:
I have a strange problem with a required field validator when I have
EnableClientScript set to true. When the client side validation fires
I get a javascript exception inside the .net javascript....
|
by: akshalika |
last post by:
Hi,
I have a repeater control. it dynamically bind textbox or dropdown base on some condition. i want to bind required field validator dynamically for validate textbox or dropdown.
here is my...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |