Why Is My Report Updating A Table

lhooker

Registered User.
Local time
Today, 15:41
Joined
Dec 30, 2005
Messages
423
Can someone tell me why the 'Name' field in the 'Gift_Totals' table is being updated with the last value of the "Recreate Totals" report that was displayed ? Only the first record for the 'Name' field in the 'Gift_Totals' table is affected. The name is selected from the 'Listbox'. Below the 'DoCmd' commands used.

DoCmd.OpenReport "Re-Create Report Gifts", acViewPreview
DoCmd.Close acForm, "Recreate Totals", acSaveNo

A 'Test' database is attached.:banghead:
 

Attachments

Your 'Recreate Totals' form is bound to a query 'Query_Recreate_Name', and the ListBox on that form is bound to the Name field of that query. As a result, when you make a selection in the listbox, you are editing the value in that field.

But for what that form seems to do, there is no need for it to be bound, and there is no need for ListBox to be bound either. Delete the RecordSource property of the form, and delete the ControlSource property of the ListBox control, and it will work just the same, and the Listbox will not be able to edit data.

hth
Mark
 
Mark,

I deleted the RecordSource property of the form, and delete the ControlSource property of the ListBox control, but now no data on the report. I don't understand why Query_Recreate_Survey is not receiving the Name. The query criteria is [Forms]![Recreate Totals]![Name]. Any idea why ?
 
Did you select something in the listbox on the form? You still need to make a selection in the listbox, and there won't be default selection now that there is no underlying row.
hth
Mark
 
You've a wrong reference in the query "Query_Recreate_Survey", you've "[Forms]![Recreate Totals]![Name]" it need to be "[Forms]![Recreate Totals]!
[ListBoxName]".
Database attached.
 

Attachments

JHB,

Thanks ! ! ! That worked. Also, Thanks MarkK ! ! !
 

Users who are viewing this thread

Back
Top Bottom