Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 876
  • Last Modified:

not able to put data in a sub form in access 2010

i have some problem with a sub form that i don't able to put data in one field,  it's locked.

this is the way how i build the database


i have a category Table that have this Fields
categoryID
CategoryName

i have a product list table
that have this fields
productID
ProductName

i have a table invoice
that have this fields
invoiceId
CustomerName
etc....


and i have another table for the lines items in every invoice
and it's include this fields
InvoiceDetailsID
invoiceid
Product
InvoiceDetailsCategory(based on A ID in CategoryT)
qty
Price

and i make for invoiceID a sub form that based on the invoiceId In the Invoice table
and its based on a query that the sql code is like this
"SELECT InvoiceDetailsT.InvoiceDetailsID, InvoiceDetailsT.InvoiceID, InvoiceDetailsT.Product, InvoiceDetailsT.Qty, InvoiceDetailsT.Price, InvoiceDetailsCategoryT.InvoiceDetailsCategory
FROM InvoiceDetailsT INNER JOIN InvoiceDetailsCategoryT ON InvoiceDetailsT.InvoiceDetailsID = InvoiceDetailsCategoryT.InvoiceDetails"

and in the query result i'm able to type a num in the InvoiceDetailsCategory field but in the form this field is closed. why is this?

thanks a lot
0
bill201
Asked:
bill201
1 Solution
 
Dale FyeCommented:
What you need to do is get rid of the INNER JOIN (and everything after it) in the query that is the recordsource for your form.

Then change the control fo your Category from a textbox to a combo box, and set the RowSource of that combo box to something like:

SELECT CategoryID, CategoryName from tblCategories  ORDER BY CategoryName

Then set the ColumnCount to 2, and column widths to 0 and 1 (or whatever it takes to display the CategoryName field).  The controlSource of the combo should be the [InvoiceDetailsCategory] field

Now, not only will that field be updateable, but you will be able to see the category name, rather than having to memorize the category numbers.
0
 
bill201Author Commented:
good advice thanks a lot
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Tackle projects and never again get stuck behind a technical roadblock.
Join Now