Re: subform issue

Tech-Archive recommends: Speed Up your PC by fixing your registry



you're welcome, glad it worked for you! :)


"Patttt" <Patttt@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D6AD3B1C-7C42-49CA-A1EC-B6CB7224794A@xxxxxxxxxxxxxxxx
Hi Tina,
I just wanted to let you know that your expertise was a terrific help! I
fixed the problem - everything is running smoothly. You're the best!
Pat


"tina" wrote:

well, in the subform, i'd get rid of the two-table query. bind the
subform
to tblOrderDetails, or to a query that includes only tblOrderDetails.
make
sure the subform is linked to the mainform, by setting the
LinkChildFields
property to OrderID (which refers to the OrderID foreign key field in
tblOrderDetails) and setting the LinkMasterFields property to OrderID
(which
refers to the OrderID primary key field in tblOrders).

if you want to see/choose products by name, in the OrderDetails subform,
then add a combobox control in the subform, with the ControlSource set
to
the ProductID field in tblOrderDetails, and the RowSource set to a SQL
statement based on tblProducts, something like

SELECT ProductID, ProductName FROM tblProducts ORDER BY ProductName;

set the combobox control's BoundColumn to 1 (the default), the
ColumnCount
to 2, and the ColumnWidths to 0";2" so the ProductID will be correctly
stored in the ProductID field in tblOrderDetails, but the combobox
control
in the subform with *display* the product name, not the id.

hth


"Patttt" <Patttt@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0EB51FEA-911F-4F0B-A035-845ED84D4A0B@xxxxxxxxxxxxxxxx
The subform is based on a query that does contain my data when I open
the
query. It's based on 2 tables that have primary key/ foreign key
relationships. The query contains a field called "product id" that is
the
primary key one of the tables. However, an early designer added some
code
that replaces the product id number with the name of the product
(another
table that is also related). I had it working once in the subform, but
it
only displayed the product id code - not the product name. Now, I
don't
have
any entries in the subform at all. To answer your questions:
1. the mainform is bound to the Orders table
2. Order Id is the primary key of Orders
3. The subform is bound to a query based on Orders and Order Details
tables.
the tables are related on the Order ID field.
4. Order ID from Order is part of the query (not displayed in the
subform).
Order ID is part of the main form and displayed on the main form.

Thanks so much for your help! For some reason, the query DOES display
the
records, but the subform doesn't AND we can't add anything new via the
query
or the subform. Pat


"tina" wrote:

you need to go back and look at the tables/relationships. what table
is
bound to the mainform? what is that table's primary key field? what
table is
bound to the subform? does that table contain a foreign key field
that
links
back to the primary key field of the first table? if yes, is that
foreign
key field included in the RecordSource of the subform? is the
primary
key
field of the first table included in the RecordSource of the
mainform?

hth


"Patttt" <Patttt@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:53FCC2A7-3347-46FE-B756-621215A92E34@xxxxxxxxxxxxxxxx
nope....that didn't fix it. I did notice, though, that I have an
error
message on the status bar that says "join key of table Order
Details
not
in
record set" when I try to add a new record. I don't have any idea
where to
go
to fix it!

"Patttt" wrote:

"Allow Additions" says yes, although "Data Entry" says no. I'll
try
changing
that one. thanks!

"Brian" wrote:

Check your subform's AllowAdditions property. Did it get set
to
False
somehow?

"Patttt" wrote:

Is there a reason why a subform won't let you enter new
data? I
can
enter new
data in the main form section just fine. The subform does
have
the
dropdown
list that displays the correct choices, but when I click on
one
of
them,
nothing is entered in the field. Essentially, the subform
only
displays the
existing data but won't let you enter new records. The
tables
ARE
related, so
it's not a relationship issue. any thoughts? Thanks for your
help!
Pat








.



Relevant Pages

  • Re: subform issue
    ... if you want to see/choose products by name, in the OrderDetails subform, ... then add a combobox control in the subform, ... SELECT ProductID, ProductName FROM tblProducts ORDER BY ProductName; ... The subform is bound to a query based on Orders and Order Details ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Attn Sprinks - clarification on VB code
    ... cboProduct refers to the combo box on the main Batch form that holds ... Not sure what you mean by “running the query on its own returns no records”. ... BatchID and the ProductID from the form. ... The last statement requeries the subform. ...
    (microsoft.public.access.forms)
  • Specify date criteria for subform data
    ... I need help to specify date criteria in a subform without using a parameter ... This works fine as criteria on the query, but I want the user to be able to ... purchases subform and a sales subform linked on productID. ...
    (microsoft.public.access.formscoding)
  • Re: Changes to "get the latest data point" for SQL Server 2008?
    ... The standard trick to get around this restriction is to use a common table expression to get the values from the windowing function and then to use that cte. ... rankOVER(PARTITION BY productId ORDER BY pricedate Desc) As rankvalue ... Then you can query the view, for example, ... approach is that that inner query can't be improved by WHERE's applied ...
    (microsoft.public.sqlserver.server)
  • RE: help on primary keys
    ... There are a number of things you need to do to your form and subform: ... control (i.e. the control in the main parent form's Controls collection which ... It will also automatically insert the correct ProductID value when a new ... LicensesTable has the fields ProductID, Licenses, ExpDate, Staff, etc. ...
    (microsoft.public.access.gettingstarted)