Upcoming deadline / Need help with requery

PerkinsSlave

New Member
Joined
Feb 1, 2004
Messages
26
We have a form called "frmScorecard" based on a table called "tblScorecardFinal." When the form loads, it's filtered to load to a specific record. When the form loads, it displays the data that's already been saved to the table. Ok so far.

Now, we have several text boxes with a similar problem - I'll just detail one here. We have a list box called "txtProdBucket2Calls." It's control source is bound to a corresponding field in the underlying table, "ProdBucket2Calls." Now, when the form is opened, there is no data in "ProdBucket2Calls" in the underlying table.

The control's rowsource is set to "SELECT qryBucket1C.Bucket1AHT FROM qryBucket1C; " That query works. The data displays on the form. However, when we close the form the data from the control does not pass & save to the underlying table.

I have experimented with DAO .Edit, "me.txtProdBucket2Calls.requery", and nothing seems to work.

Any suggestions?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
You have 2 main options. If the textbox that you are synchronising to is a bound control (ie it gets its data from a field in a table / query) and you are synchronising with the same field in the subform, try the Parent/Child fields approach.
1. In Design view on the main form, click the subform ONCE and select the Properties icon in the toolbar. You should see the Link Parent /Child fields (or something liek that) property. Click the builder (...) to the right of the property and select the matching fields. That will do it.

If the field on the main form is unbound you will need some code.
MyTbx is the textbox that the subform synchronises to. It's on MyForm.
The Subform has an underlying query. The criteria row for the matching field should be [Forms]![Myform]![MyTbx]
Now,
You'll need to attach this to one or more events -- the On Load and On Current events of the main form, and the After Update event of the textbox whose data is being synchronised.
[MySubFormName].Form.Requery or [MySubformname].Requery

(can't remember the exact syntax, but one of the above).

HTH
Denis
 
Upvote 0
Hi Sydney,

Thanks for the reply. We ran into an additional problem dealing with nulls in some fields, so we completely changed our approach. Instead of querying for the data, we did all the updates programmatically through DAO. It works like a charm!

Thanks,
Paul
 
Upvote 0

Forum statistics

Threads
1,221,672
Messages
6,161,198
Members
451,688
Latest member
Gregs44132

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top