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

Storing Values in database using Forms

P: 14
Hello guys again! Back with invoice problems. Just want to know how to store data in the main database in different tables and fields using a form. I have a datasheet view of a form where i have to show ;

Expand|Select|Wrap|Line Numbers
  1. invoice number                      (INPUT) 
  2. price                                     (INPUT)
  3. No. of units                            (INPUT),
  4. Weekly Total          (calculated by =[no_of_units]*[price]) 
  5. start date                               (INPUT)
  6. end date                                (INPUT) 
  7. days                      (=[end_date]-[start_date]+1)
  8. total amount           =(([Weekly_total]*[days])/7)
Now, All this is working but not storing the values. If that works i will be jumping for a whole week :P Please help me jump. What should i do to store these values in specific fields..:)
Takecare
thanks in advance

mj
Jul 31 '07 #1
Share this Question
Share on Google+
10 Replies


missinglinq
Expert 2.5K+
P: 3,532
You have inadvertently posted your question in the Articles section rather than in the Forum section of our site, so I have moved it across for you.

Linq ;0)>
Jul 31 '07 #2

Expert 100+
P: 296
Hello guys again! Back with invoice problems. Just want to know how to store data in the main database in different tables and fields using a form. I have a datasheet view of a form where i have to show ;

Expand|Select|Wrap|Line Numbers
  1. invoice number                      (INPUT) 
  2. price                                     (INPUT)
  3. No. of units                            (INPUT),
  4. Weekly Total          (calculated by =[no_of_units]*[price]) 
  5. start date                               (INPUT)
  6. end date                                (INPUT) 
  7. days                      (=[end_date]-[start_date]+1)
  8. total amount           =(([Weekly_total]*[days])/7)
Now, All this is working but not storing the values. If that works i will be jumping for a whole week :P Please help me jump. What should i do to store these values in specific fields..:)
Takecare
thanks in advance

mj
What are/is your table structure(s) that house the above fields? Are you currently using a query for your form?
Jul 31 '07 #3

NeoPa
Expert Mod 15k+
P: 31,419
Drago,
Remember the data is all stored in tables not on forms. Forms are like windows that allow you to see some of the data. They only hold data transiently (while they're open) and even that is logically just a view of the underlying data (tables or queries).
Jul 31 '07 #4

missinglinq
Expert 2.5K+
P: 3,532
All this is working but not storing the values.
Exactly how is it working then if it's not storing your data?
Jul 31 '07 #5

P: 14
Exactly how is it working then if it's not storing your data?
Hi again, thanks for moving this question to forum section :). Sorry about that as iam still learning the forum life style which is very helpful.

I have created an invoice table with attributes invoiceID(invoice number), item_price (price), no_of_units(Number of units), Weekly_Total, start_date, end_date, Days, Monthly_Total(total amount)
Code: ( text )
invoice number (INPUT)
price (INPUT)
No. of units (INPUT),
Weekly Total (=[no_of_units]*[price])
start date (INPUT)
end date (INPUT)
days (=[end_date]-[start_date]+1)
total amount =(([Weekly_total]*[days])/7)
I have to input data in the database table manually, except the fields where calculation is required (which is also not saving the values after calculation. Is it possible to do so?). On the form these values are displaying. I want to input these values in the database table using form or anything else. Iam not using any queries at the moment for this.

With regards

mj
Aug 1 '07 #6

NeoPa
Expert Mod 15k+
P: 31,419
Drago, storing calculated values is really NOT a good idea. If you're interested why, check out Normalisation and Table structures.
I'm confused as to how you think it might be appropriate to store total values (presumably across many invoices) in a table designed to handle invoices (individuals).
Your last post seems to say that you are editing the data directly in the table, but then goes on to refer to a form you are using. I'm confused as to what is actually hapening. The form would make more sense certainly.
Aug 1 '07 #7

P: 14
Drago, storing calculated values is really NOT a good idea. If you're interested why, check out Normalisation and Table structures.
I'm confused as to how you think it might be appropriate to store total values (presumably across many invoices) in a table designed to handle invoices (individuals).
Your last post seems to say that you are editing the data directly in the table, but then goes on to refer to a form you are using. I'm confused as to what is actually hapening. The form would make more sense certainly.
Thanks for your reply. Amm... so form are used just to view records. Thats fine. Suppose if I want to store values (not edit) in database using an interface. What should i do then. For example what i mean is if u enter name, dob, address in 3 different text fields it goes in to the database and create a new record.
I hope this will help u.
Aug 1 '07 #8

NeoPa
Expert Mod 15k+
P: 31,419
Forms can certainly be used as an "interface" for adding, editing and also deleting records in a table. The data is still "stored" in the table but it is displayed on the form.
The database, is an object which contains all the code, forms queries AND tables (etc etc).
Aug 1 '07 #9

P: 14
Forms can certainly be used as an "interface" for adding, editing and also deleting records in a table. The data is still "stored" in the table but it is displayed on the form.
The database, is an object which contains all the code, forms queries AND tables (etc etc).
great...so now for example if iam calculating values on the form taking some values from database like

attribute A= 90 - want to save in the database
attribute B=30 - want to save in the database
attribute Total= A-B = 60 - this calculated value i want to save in the table

please dont be mad at me as iam trying my best... iam new to this...
Aug 1 '07 #10

Expert 100+
P: 296
great...so now for example if iam calculating values on the form taking some values from database like

attribute A= 90 - want to save in the database
attribute B=30 - want to save in the database
attribute Total= A-B = 60 - this calculated value i want to save in the table

please dont be mad at me as iam trying my best... iam new to this...
As NeoPa said, you should not be storing attribute Total in the table. It is fine if you have a textbox on your form that calculates the total, or if you design a query that calculates it, but you shouldn't actually store the value. In the quote above, you seem to not have actually asked a question regarding what you want to save in the table. What are you trying to ask?
Aug 1 '07 #11

Post your reply

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