Solved

Continuous form field changes for current record

Posted on 2004-09-01
5
353 Views
Last Modified: 2008-03-10
I have a form that is used as a continuos form subform. It's bound to Table1 (for sake of the explanation). One of the fields on the form is a calculation that is imported from a query. I have the sql for the Row Source functioning so that, if the subform is removed from it's parent, it works as it should, displaying the proper calculation for each record. However, as a subform, as focus changes to the new record, the fields for all records change to the value for the current record.

Is there a way I can fix this without reinventing the wheel?

Thanks.
RWW
0
Comment
Question by:PstWood
  • 2
  • 2
5 Comments
 
LVL 7

Assisted Solution

by:rockmuncher
rockmuncher earned 63 total points
ID: 11958559
Only by including the control source in the underlying recordsource for the form.  That is, you can't use a separate query if you want the value to display correctly for each record in continuous forms view.

Be aware that this sometimes gets in the way of the ability to edit if the resultant query is not updatable.
0
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 62 total points
ID: 11958634
Wait, there *is* a way, thinking about it.

Make the text box a combo box. Bind it to the same field as the other text box, but make it non-editable (set its Enabled property to No and Locked to Yes). Make sure the combo box has 2 columns, the first one is the item ID and the second is the item category. Hide the first column and I think that will do it.
0
 
LVL 7

Expert Comment

by:rockmuncher
ID: 11958676
>>  Bind it to the same field  << the problem will be that the text box in question is not bound to the form's recordsource.  If there is no context link between the recordsource of the form and a control then you can't expect them to remain in sync
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 11958689
Yes, but you can bind it - in which case they will be kept in sync, as changing the editable control will change the non-editable one too.
0
 

Author Comment

by:PstWood
ID: 11960483
rockmuncher and shanesuebsahakarn were both right and both wrong. :-)

rock was right that the control source had to be in the underlying recordsource in order to work and shane was right that the text box had to be converted to a combo box. The solution was to make a query based on the Table1 and including in that query the field from the first query, then binding the resultant field in question to the combobox on the form. Then the right select statement in the Row Source makes the correct info appear in the combo box and stay there when the next record in the continuous form is changed.

Thanks to both for ideas to get it fixed. You split the points.
RWW
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question