Exit Forms

benc

Registered User.
Local time
Today, 20:06
Joined
Dec 31, 2001
Messages
57
After creating a command button to open another form. Upon click to open the new form how can i get the current form to close. Can anyone help Thanks.
 
Private Sub "YourControlName"_Click()

DoCmd.Close acForm, "[frmYourForm]", acSaveYes
'Close Form
'acSaveYes saves any changes to the form without prompting


DoCmd.OpenForm "[frmYourFormToBeOpened]"

End Sub
 
Hi thanks for helping me but i dont seem to be able to get it working. This is the code as i understand it:

Dim userform As String
Dim stLinkCriteria1 As String

userform = "User Form"
DoCmd.Close acForm, "[username]",acSaveYes
DoCmd.openform userform, , , stLinkCriteria1

End Sub

Sorry if it something silly that i have done wrong, i have only been doing VB for a couple of weeks.

Thanks

Ben
 
You have not supplied a value for stLinkCriteria1.
 
I used the wizard to do the command to open the form so its just something that has put in. in doesnt make any affect as it still opens the form. The bit that i am struggling on is getting the form that it is currently in to close after opening the new form. Does this help?

Thanks

BEN
 
Someone tell me if im wrong by doing this but I quite simply made a macro that closes form then opens new one.

Liam
 

Users who are viewing this thread

Back
Top Bottom