Re: Update--Re: auto fill form based on combo-box selection
- From: J <J@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 11 Apr 2007 16:44:04 -0700
I'm not that familiar with running in debug but it looks like the value I'm
getting for ActiveArea is "Null". It appears that the only time I get a value
is when I set Column to 0 or 1. That's probably a clue to what's wrong but I
don't get it.
The combo box is based on a query of tblProdSpecs. The table fields are:
Spec_ID - Autonumber
SpecID - Text
CRecipe - Text
ActiveArea - Number
MembraneType- Text
The query contains all of the above except for Spec_ID with Bound Column set
to 1.
"Jeff Boyce" wrote:
Have you run your code in debug mode to confirm that.
Me.ProductSpec.Column(2) is returning what you expect it to?
Regards
Jeff Boyce
Microsoft Office/Access MVP
"J" <J@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:00C1A8EE-C13B-4BB5-A17F-0B388E19565D@xxxxxxxxxxxxxxxx
I tried the following code to do what I'm attempting:
Me.CRecipe.Value = Me.ProductSpec.Column(0)
Me.MembraneType.Value = Me.ProductSpec.Column(1)
Me.ActiveArea.Value = Me.ProductSpec.Column(2)
CRecipe and MembraneType are text fields and they update fine.
ActiveArea is numeric and it won't update.
Do I need to add some qualifier or something?
Help is appreciated.
"J" wrote:
I see it more as "target" or "spec"(pre-filled value) and Actual (saved
value).
The supervisor will maintain the Spec table to communicate what the
target is
and the operator will enter the actual data.
"Jeff Boyce" wrote:
So it sounds like you are considering re-storing the same data multiple
times. This sounds more like what you'd do with a spread*** than a
relational database.
Have you looked into relational database design, and "normalization"?
You
really won't be able to get the best use of Access' features and
functions
if you feed it '*** data.
Regards
Jeff Boyce
Microsoft Office/Access MVP
"J" <J@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:516AF9DD-1741-46B0-9DB8-2AEB6D5EA544@xxxxxxxxxxxxxxxx
No, I plan to save the data, either the default (pre-filled) value or
a
changed value if the user over-rides the default.
"Jeff Boyce" wrote:
If I'm understanding your description, you want to be able to
display
corresponding values once a selection is made. If the ONLY thing
you are
doing is displaying those looked-up values, and are not planning on
(re-)saving them (i.e., the controls are unbound), then you could
easily
do
that by:
> include the values you will want shown as fields in the query
you use
to
feed the combo box
> create an AfterUpdate event for the combo box
> in that event, add something like:
Me!txtSprayArea = Me!cboRecipeName.Column(1)
Me!txtGDL_Material = Me!cboRecipeName.Column(2)
...
Check Access HELP on using .Column(n) -- it is zero-based, so you
start
counting at "0".
Regards
Jeff Boyce
Microsoft Office/Access MVP
"J" <J@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CA153100-F574-4F83-92E3-B2169FC1DFCD@xxxxxxxxxxxxxxxx
Instead of creating several forms with different default values, I
would
like
to "auto-fill" some of the fields based on the value selected on
the
first
combo-box on the form. The defaults would come from a table. For
example
tblSpecs would contain RecipeName, SprayArea, GDL_Material, etc.
On my
form
when the user selects RecipeName, the vlaues for SprayArea,
GDL_Material,
etc
would auto fill with the corresponding values from the table where
RecipeName=RecipeName. I think this is probably do-able but I
don't
have
much
coding experience. Help is greatly appreciated.
- Follow-Ups:
- Re: Update--Re: auto fill form based on combo-box selection
- From: John W . Vinson
- Re: Update--Re: auto fill form based on combo-box selection
- References:
- Re: auto fill form based on combo-box selection
- From: Jeff Boyce
- Re: auto fill form based on combo-box selection
- From: Jeff Boyce
- Re: auto fill form based on combo-box selection
- From: J
- Update--Re: auto fill form based on combo-box selection
- From: J
- Re: Update--Re: auto fill form based on combo-box selection
- From: Jeff Boyce
- Re: auto fill form based on combo-box selection
- Prev by Date: Re: Conditional Format logic
- Next by Date: Re: Problem with UDF to fill list box
- Previous by thread: Re: Update--Re: auto fill form based on combo-box selection
- Next by thread: Re: Update--Re: auto fill form based on combo-box selection
- Index(es):