Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On Closing form prompts to save.

Status
Not open for further replies.

Razor1

IS-IT--Management
Nov 21, 2002
81
US
I open a form in design view and change the row source for a multilist box. I then save the form and reopen it. When I close the form after reopening it the prompt to save the form appears. There has been no change in the form since the last save.
Any ideas on why it asks to save again?
Here is the code:
DoCmd.OpenForm "frm_BookingsRpt_Select", acDesign
Forms!frm_BookingsRpt_Select!SalesRepChoice.RowSource = strSQL
DoCmd.Close acForm, "frm_BookingsReport_Select", acSaveYes
DoCmd.OpenForm "frm_BookingsRpt_Select"

Thanks in advance for any help provided.


Razor1
 
Code:
 DoCmd.Close acForm, "frm_BookingsReport_Select", [b]acSaveYes[/b]

Change to [tt]acSaveNo[/tt]?

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
I tried your suggestion and the same and the dialog box still comes up asking to save.

I need to save the form with the new row source before I reopen the form.


Razor1
 
I still use Access 2000 and unless newer versions work differently, I don't understand why you'd have to open the form in design view, modify the rowsource of a control and close the form. Why not just open the form and change the rowsource of the control leaving it unsaved when closing it? If it's only being opened via a button on another form, the other form can or will always set the rowsource immediately once the form opens.

Second, the form being opened "frm_BookingsRpt_Select", is not the form being closed with save, "frm_BookingsReport_Select
 
From the code I'm guessing that your trying to set the row source in [tt]frm_BookingsReport_Select[/tt] from the first form before you present to the user?

Try using [tt]OpenArgs[/tt] to pass [tt]strSQL[/tt] when you call [tt]OpenForm[/tt].

CMP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top