By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 3,094 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Adding a new line to subform

P: 30
I have a form that is an Order Form. The subform is where the user would enter the item they want to order. The subform is in datasheet view. The fields are:

SKU (Combobox)
Product Name
Unit Price
Quantity
Total Price (which calculates the sum of that line)

Only one line is showing right now. I want a new line to appear when the user hits enter in the Total Price field so they can enter another item. I have searched help and the how to section but maybe I'm looking for the wrong thing. I don't have any code in the AfterUpdate field which I'm thinking I need to put something but don't know what.

Also the Unit Price which is automatically filled from the combobox is displaying 4.5 even though the query it is coming from displays $4.50. I couldn't find anything on this one either.

One more question is where should I look to find out how to update an Orders table after the order is submitted so that I can track all the orders?

Let me know if you need more info

Thanks
Mar 9 '08 #1
Share this Question
Share on Google+
10 Replies


lee123
100+
P: 556
is the subform a contiuous form if not make it a continuous form in the properties of the form under "all"

lee123
Mar 9 '08 #2

lee123
100+
P: 556
i should say in the subform properties

lee123
Mar 9 '08 #3

P: 30
I went to the properties of the subform under All and changed the default view to Continuous Form instead of Datasheet View. But now it looks like a form and not in datasheet view when I open it. Did I change it in the wrong place?
Mar 9 '08 #4

lee123
100+
P: 556
no I'm sorry i should of asked you how you had your form is this what you wanted or to keep what you had before? because I'm use to making my own from scratch with out the wizard. if you don't like the way it looks then change it back

lee123
Mar 9 '08 #5

lee123
100+
P: 556
if you want you can make your subform got to this:
http://www.ladaccessvb6.com

i think i did this right

lee123
Mar 9 '08 #6

P: 30
Hi,

I followed your instructions on how to make a subform exactly creating a new subform, but when I open it, it still looks like it is in a 'form' format and not datasheet format. Any other ideas?

Thanks
Mar 10 '08 #7

lee123
100+
P: 556
i'm confused about what it is you want, in your post you asked to enter in a new line in you subform the webpage i directed you to in my last post shows you how to make a subform instead of using the wizard with this you can make add a new line in the subform by making it a continuous form
As i was reading your post again you want a form but not a form but a datasheet to keep track of the orders like a summary ? if so just make a query and what ever you add will show up in the query in datasheet view

lee123
Mar 10 '08 #8

Expert Mod 2.5K+
P: 2,545
I have a form that is an Order Form. The subform is where the user would enter the item they want to order. The subform is in datasheet view. ...
Only one line is showing right now. I want a new line to appear when the user hits enter in the Total Price field so they can enter another item....
Also the Unit Price which is automatically filled from the combobox is displaying 4.5 even though the query it is coming from displays $4.50. I couldn't find anything on this one either.

One more question is where should I look to find out how to update an Orders table after the order is submitted so that I can track all the orders?
Hi. The form style (datasheet, continuous forms and so on) is not what is stopping your form from adding records. There are some checks you need to make to rule out particular causes. First, make sure that in both the subform and main form properties Allow Additions is set to Yes. Second, check the recordsource property of your subform. If this is a query, run the query itself from the database Queries tab and check that the new record indicator (the asterisk in the record indicators at the end of the table) is not greyed out. If it is, the query's table joins or structure is incorrect.

It is also possible that the relationship between the table on which the main form is based and the table on which the subform is based is not correctly set. I mention this because of your last question on updating the orders table; if the table relationships are set correctly and you are entering order details on the main form with order lines on the subform the updating of these records should be automatic. You should not have to be updating anything after the order is made (except for deliberate changes in response to changes to an order).

On the unit price problem set the format property of the control to currency and decimal places to 2.

Let us know how you get on with your recordsource and form properties checks.

-Stewart
Mar 10 '08 #9

P: 30
Hi,

I did all of the checks you suggested but nothing really worked. Then I decided to make the ProductName and the Unit Price a bound field. They were unbound before and I don't remember why I did that in the beginning, but it worked at the time. The recordsource was a SELECT statement which I made with the build button. I changed that to a query of PRODUCTS. That worked and I was able to add lines and the unit price was in the correct format.

I guess I don't understand the bound and unbound field stuff. When I get home, I will reread that part in my access book.

I also started looking at the relationships on my two tables CUSTOMERS and PRODUCTS. They are linked by CustomerID which is an autonumber field in CUSTOMERS and a numeric field in PRODUCTS. I'm now thinking that I can't do this. I need to relook at how I have this set up and maybe start the form process from scratch. Before I do that, what fields should I link they together with? The CUSTOMER and PRODUCTS tables have no common fields. I'm just pulling info from then. Later when I add the ORDERS table, do I need to link that using the same field.

I am going to seach this site some more and reread my books, but any tips will be appreciated.
Thanks
Mar 11 '08 #10

P: 30
I think I figured out most of my problems, but one. When the form updates the ORDERS table, it puts all of the items that the customer orders and puts their name in a different record. This is what my form looks like:

At the top coming from the CUSTOMER table:
Name
Address
City, St, Zip

The subform called PRODUCT SUBFORM coming from the PRODUCTS table:
SKU #
Product Name
Unit Price
Quantity

My ORDERS table has the following fields in it:
Name, Address, City, ST, Zip, SKU#, Product Name, Unit Price, Quantity

After I enter an order this is what my ORDERS table look like:
Record 1 - Everything is blank except for Customer Name
Record 2 - All Product info is filled in and there is the word 'Order Form' in the Customer Name field which is the name of my main Form.

How do I get the Customer info (the person who order the items) in those field on the same record that the order info is in?

Thanks
Mar 12 '08 #11

Post your reply

Sign in to post your reply or Sign up for a free account.