Command buttons on switch form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

All my command buttons on one switch form are now failing. No error message.
Just do not do the OpenForm command they were "programmed" to do through the
Command Button wizard. Were all working up until a couple of hours ago. Am
not sure what I did. Am still able to open the forms from the Forms listings.
 
Hi Patricia

Can you post the code behind the button

Open the form in design view
Right click the button and select properties
Select Event
Select On-Click (build)
Copy the code (on click)
Paste it here

May be you can be helped if the code can be seen here.
 
Private Sub Dohmann_Click()
On Error GoTo Err_Dohmann_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Dohmann"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Dohmann_Click:
Exit Sub

Err_Dohmann_Click:
MsgBox Err.Description
Resume Exit_Dohmann_Click

End Sub
 
MMmmm Looks OK to me

Try this.

Create a new button (called NewButton) and use this (as you can see there
are no filters on this (ie. you want to open Dohmann with all records)



Private Sub NewButton_Click()
On Error GoTo NewButton_Click_Err

DoCmd.OpenForm "Dohmann", acNormal, "", "", , acNormal


NewButton_Click_Exit:
Exit Sub

NewButonn_Click_Err:
MsgBox Error$
Resume NewButton_Click_Exit

End Sub


and see if this work.
 
Thank you but I created the new button and still the same result. The only
button on my switch form that works is the one I created called "Close" that
activates a macro.
 
I have also been working in the "User and Group Permissions" area. Is there
a setting there that would have changed the function of a command button??!
 
Try this to get rid of everything other than opening the form

Private Sub NewButton_Click()
DoCmd.OpenForm "Dohmann", acNormal, "", "", , acNormal
End Sub

let me know if it works

Also do you have any OnLoad, OnOpen, OnActivate, etc items on the form
Dohmann
 
The code below (for just opening the form) did not work.
The form has a On Open setting of "Maximize" - a macro to display the form
in a full window. Thanks.
 
Back
Top