Solved

Continuous form field changes for current record

Posted on 2004-09-01
5
354 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

860 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