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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enter Parameter Value box when Form Close?? 3

Status
Not open for further replies.

Chuter

Programmer
May 22, 2002
8
CA
When I close an unbound form I receive a series of "Enter Parameter Value" boxes that reference some unbound text boxes on the form. The Close command button uses the code DoCmd.Close....no other code that would trigger a query etc. Form's On Close event is blank (not coded). Weird thing is that I don't get these dialog boxes when I close the form using the close button in the upper right hand corner of the window. I've been coding in MS Access for quite a while and have never come across this before.

Any help would be greatly appreciated!!
 
How are ya Chuter . . . . .

Have you tried:
Code:
[blue]   DoCmd.Close acForm, "[b]YourFormName[/b]", [purple][b]acSaveNo[/b][/purple][/blue]
?

Calvin.gif
See Ya! . . . . . .
 
Chuter . . . . .

Hit submit too soon . . . .

If my prior post doesn't work, try . . .
Code:
[blue]   Me.[purple][b]RecordSource[/b][/purple] = ""[/blue]
. . . before [blue]DoCmd.Close[/blue] . . .

Calvin.gif
See Ya! . . . . . .
 
AceMan1 and RoyVidar......thanks for your help on this!! It's been driving me crazy for days now. I'll let you know how I make out.

Thanks again...Chuter
 
RoyVidar: I went to the Microsoft link you provided and their workaround worked perfectly:

DoCmd.Echo False
DoCmd.Close
DoCmd.Echo True

Thanks again!!
 
How are ya RoyVidar . . . . .

Now thats a bug! and [blue]one for the books![/blue]


Calvin.gif
See Ya! . . . . . .
 
Chuter . . . . .

A note on Echo . . .

Whenever you decide to use the [blue]Application.Echo[/blue] or [blue]DoCmd.Echo[/blue] method, [purple]a saftey measure needs to be installed.[/purple] This is in case [blue]VBA fails while Echo is turned off[/blue] (Application.Echo False). What happens is, [purple]it appears as if everything is locked-up or dead, can't click anything and so on.[/purple] The saftey is a [blue]HotKey Combination[/blue] in an [blue]AutoKeys[/blue] macro that [blue]turns Echo back on[/blue], bringing you back to normal operations.

Installation:

In a module in the modules window, copy/paste the following code:
Code:
[blue]Public Function RestoreEcho()
   Dim Msg As String, Style As Integer, Title As String
   
   Application.Echo True
   
   Msg = "Application Echo is on!"
   Style = vbExclamation + vbOKOnly
   Title = "Echo Default Enabled!"
   MsgBox Msg, Style, Title

End Function[/blue]
Next we setup the hotkey [purple]Ctrl + E[/purple]. In the Macros Window, if you dont already have an AutoKeys macro start a new macro, else open your existing AutoKeys. The coding for the hokey should appear as follows:
Code:
[blue]Macro Name    Action       Function
----------  ----------  --------------
^E          RunCode     RestoreEcho()
            StopMacro[/blue]
Enter the [blue]^[/blue] using [blue]Shift + 6[/blue]. Close/Save the macro, saving name as [blue]AutoKeys[/blue] if a new macro.

Thats it . . . . test the hotkey combination. [blue]A confirmation window should popup![/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top