Solved

Continuous form field changes for current record

Posted on 2004-09-01
5
352 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
Comment Utility
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
Comment Utility
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
Comment Utility
>>  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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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 …

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now