update from datasheet view

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

Guest

Hi,
I have a subform in the Datasheet view, not all the fields are
displayed. When a new record is entered, the hidden fields are not updated.
e.g. I know the primary key of the record and it's not displayed on the
subform. How can I manually pass that in when the record is updated.

let say the record has the following fields
order# (hidden), Qty (shown), item# (shown).
when the user can only enter Qty and Item#, how do I append Order# to the
record?


Thanks.
 
Jeff,

Do you mean that this subform is a subform on a main form which contains
the order#? If so, you can use the Link Master Fields and Link Child
Fields properties of the subform to control this. If this is not what
you mean, how is the subform meant to "know" which order# to put in?

By the way, it is not a good idea to use a # as part of a field name.
 
steve,

I have a listbox (sample name) on the right side of the from, whatever
is clicked by the user, it then querys a different table for that sample name
and load all the info abt that sample. on that recordset, there are order#,
order items, qty. (order# is hidden (not shown in the datasheet). What i m
trying to do is, when the user clicks on a record (any cell on the
datasheet), queries and return recordsets (where order.ordernumber =
orderdetails.ordernumber)


Thanks
 
Steve,
I didn't read your question correctly, and I thought i was answer
another post (that's my 2nd problem on the project).
Like I mentioned on that post, I have a listbox (source is from a table
only contains sample name), the user clicks on that listbox (it'll then query
a different table for sample name), it returns the name, order#, Order ITem,
and Qty. Therefore, Order# is known eventhough that's not displayed on the
datasheet (the column is hidden). however, since it's a hidden column, the
user cannot enter that value, as the result when new records are added into
that table, that field becomes blank.

Thanks
 
Jeff,

To state the painfully obvious... Why don't you make the Order# field
visible?
 
Steve,
The primary reason is to make sure the user doesn't miss type the order#
(that would be disasterous).
I got away w/ it by inserting code in after insertion event. I use ado
to select all the records (should be only one - for the latest entry) with
order # is null, and use recordset update to add the order# into that record.

Thanks for your time steve
 
Back
Top