Solved

Continuous form field changes for current record

Posted on 2004-09-01
5
356 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

696 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