getting value from unbound control to query field

ijaz1976

Registered User.
Local time
Today, 13:41
Joined
Jan 30, 2011
Messages
28
updating unbound text-box value for each record

hello !
in my database on fee-voucher i have two fee text-boxes according to dates for every student which are "fee" "late fee" and an unbound control. each text-box have a check-box in front of it and only one check-box can be selected for one record. when a check-box is checked. value of that field goes to unbound text-box next i want to use this value in a query to calculate fee paid in a report. this setup is working fine. Now problem is how to change value of unbound text box according to each record. it is now getting value from only one record and showing this value on all records when i check a check-box in next record then it gets its value from that record and show on all previous and next records how to solve this problem i have to get only one value to calculate on report because every student will pay only one fee (fee or late fee).
database file is attached.
thanks in advance
 

Attachments

Last edited:
Re: updating unbound text-box value for each record

i have solved this problem before submitting this post and changed the title of my post but i dont know why it was no updated in posts. real problem is this:
hello !
in my database on fee-voucher i have two fee text-boxes according to dates for every student which are "fee" "late fee" and an unbound control. each text-box have a check-box in front of it and only one check-box can be selected for one record. when a check-box is checked. value of that field goes to unbound text-box next i want to use this value in a query to calculate fee paid in a report. this setup is working fine. Now problem is how to change value of unbound text box according to each record. it is now getting value from only one record and showing this value on all records when i check a check-box in next record then it gets its value from that record and show on all previous and next records how to solve this problem i have to get only one value to calculate on report because every student will pay only one fee (fee or late fee).
database file is attached.
thanks in advance
any help will be highly appriciated.
 
I've inserted some code in the Form's On Current event to ensure that the unbound field T4 shows the correct amount, check that out. I've also fixed your query.

Also consider giving your fields meaningful names, be consistent with their use across tables. For example if you have a Table TBL_StudentDtl with a Primary key (PK) of StudentID be sure to use the same name for any child record that use StudentID as a foreign key (FK) to link them back to the master record.

Also consider a naming protocol along the lines of TBLl_TablName, FRM_FormName, QRY_QueryName etc. avoid spaces and other special characters, limit yourself to alpha and numeric characters and the underscore.
 

Attachments

hello john thanks for your help now form is working fine but query is not working correctly. the query takes field from current record on form and then display all values of that field for example if i check check-box c1 on current record in query it shows all values based on that check and do not get values from other records.please check query again.
can i create a report based on that form (without using query) and calculate values of unbound text-box in that report.
anyway thanks for your help at least one problem (form) is solved.
 
I'm having a little trouble following your scenario here, but in an Unbound Control the value in one instance of it is the value in all instances of it, in all records.

In order for it to reflect the value of a given record it has to be Bound i.e. have a Control Source. It can either be Bound to a field in the underlying Table or you can do the calculation in the Control Source Property for the Control.

Linq ;0)>
 
In order for it to reflect the value of a given record it has to be Bound i.e. have a Control Source. It can either be Bound to a field in the underlying Table or you can do the calculation in the Control Source Property for the Control.

Linq ;0)>

thanks for your reply but how it can be done. :confused:
 
thanks to all i have got a workaround instead of calculation on form now i am calculating sums in report directly.
anyway thank you all very much.
 

Users who are viewing this thread

Back
Top Bottom