Updating bound fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Have a numeric field that can contain numbers ranging grom 1 to 10. about
90% of the values are 1 and I am mostly interested in the fields that are >
1. I can limit the values displayed on a data entry/update form to only show
values > 1 by using an IIF() in the source query or the form control. the
problem is that I need to be able to sometimes update the value. by using
the IIF() I cnat update the field.

Is there another way to only display the values >1 but still be able to
update the underlying field??
 
Jeannie M said:
Have a numeric field that can contain numbers ranging grom 1 to 10. about
90% of the values are 1 and I am mostly interested in the fields that are
1. I can limit the values displayed on a data entry/update form to only
show
values > 1 by using an IIF() in the source query or the form control. the
problem is that I need to be able to sometimes update the value. by using
the IIF() I cnat update the field.

Is there another way to only display the values >1 but still be able to
update the underlying field??

It's not really clear what you're trying to do. Are you saying you only want
to display the control on the form if the value is greater than 1? If that's
the case, put something like this in the form's Current event:

Me.txtNumberFieldControl.Visible = (Me.txtNumberFieldControl > 1)

That way, if the value in the field is 1, the control won't show on the
form, but if the value is greater than 1, the control shows and you can
update it. Note that if you change the value in the control to 1 and you
want the control to "disappear" after you change it, you can put the same
code in the control's AfterUpdate event.

Carl Rapson
 
Do not use IIF statement but use criteria >1 and you can update. If you
change one of the records to 1, then the next time it will now show.

Alternative is to use this as criteria --
= [Enter lowest number to display]

This way you can pull all records by entering 1 or 0.

Another alternative is to use this as criteria --
=IIF([Press ENTER for all or enter lowest number to display] Is Null,
0, [Press ENTER for all or enter lowest number to display])
 
more explaination. I want the control to always appear - just not display
anything if the value of the field is 0 or 1. I want to see all records in a
subform that are associated with the record in the main form no matter the
value of the field in question. I just do not want the field in question to
display any value if the value is <2 in most caes there are 30-40 records
displayed in the subform and it would be nice if the records that have avalue
of >1 stood out from all the other blank fields
 
Jeannie M said:
more explaination. I want the control to always appear - just not display
anything if the value of the field is 0 or 1. I want to see all records in a
subform that are associated with the record in the main form no matter the
value of the field in question. I just do not want the field in question to
display any value if the value is <2 in most caes there are 30-40 records
displayed in the subform and it would be nice if the records that have avalue
of >1 stood out from all the other blank fields

Jeannie,

If I am reading your first and second messages correctly, you want to
change the comparison during runtime.

How to do this depends on how you are making the > 1 comparison now.

Please post an explanation of *exactly* where in your MS Access
database this comparison appears, and please include all associated
code (SQL, VBA, etc.). (As in, what property of what control or form;
what module, what query, etc.)


Sincerely,

Chris O.
 
Maybe something like this would work: create a second (unbound) textbox
control on your form. Hide your current (bound) textbox (set the Visible
property to False). In the Form_Current event, do something like this:

If Me.txtBoundTextbox < 2 Then
Me.txtUnboundTextbox = ""
Else
Me.txtUnboundTextbox = Me.txtBoundTextbox
End If

In the AfterUpdate event of the unbound textbox, copy its value to the bound
(hidden) textbox:

Me.txtBoundTextbox = Me.UnboundTextbox

So the user is actually interacting with an unbound textbox, and you are
shuffling things around "behind the scenes".

Carl Rapson
 
Back
Top