473,387 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Storing Values in database using Forms

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
10 3582
missinglinq
3,532 Expert 2GB
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
mlcampeau
296 Expert 100+
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
32,556 Expert Mod 16PB
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
3,532 Expert 2GB
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
drago
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
32,556 Expert Mod 16PB
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
drago
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
32,556 Expert Mod 16PB
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
drago
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
mlcampeau
296 Expert 100+
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

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

Similar topics

2
by: Venus | last post by:
Hi all, Newbie here!! I have 4 forms(A,B,C,D) and a thank you page for my questionnaire. People will be redirected to B or C depending on the last question's answer. B or C will redirect to D...
4
by: Heather | last post by:
Hi I am desparately looking for advice in relation to storing the results after selecting items from two combo boxes on a Referral form. The first combo box 'ctl Type' displays a full list of...
4
by: Hazzard | last post by:
What is the best way to do this? Binary with 0 representing off and 1 on? Int16 with 1 representing first button, 2 the second, 3 ... varchar with a character values at certain positions in the...
9
by: Brad | last post by:
I have written some code to manipulate data/records in a MASTER (order header) and DETAIL (order details) tables. What I have written is too extensive to post but essentially trying to: 1....
14
by: John Welch | last post by:
Hi all. I'm creating a FE/BE database that will be used by about 6 users. As usual, I have several fields, such as "OrganizationTypeID" that will get values (via combo boxes in forms) from separate...
2
by: Frankie | last post by:
Using SQL Server 2005 and .NET 2.0; I'm creating a Windows Forms application that will need to display photos of people, along with a bunch of information about each person. In a Web...
7
by: Mike | last post by:
I have developed an application, for psyc patients.... they type in very personal information in a web form to help them work through problems in their lives. Once they enter the info, I encrypt...
10
by: madereal | last post by:
Situation: I have a database that has users with different levels of access to the information they are allowed to view. I have addressed this issue by creating a login form that opens on startup....
2
by: Mythran | last post by:
We followed an example found on MSDN to create an encrypted FormsAuthenticationTicket and storing the ticket in a cookie. Is this the "correct" way to store the authentication ticket? We are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.