Hi
I have a problem which has been bugging me for a while now, so thought I would sign up here to get it sorted! So here it goes.
I have a form with a close button on it. I have written a code for it which is as follows. (It has been condenced though)
if isnull (FirstName) and isnull (LastName) then
if msgbox "Are you sure you want to close? This record will not be saved", vbyesnocancel) = vbyes
docmd.runcommand accmdundo
docmd.close
docmd.openform "F_MainMenu"
else
If not isnull (FirstName) and not isnull (LastName) then
if msgbox ("Do you want close?, vbyesnocancel) = vbyes then
docmd.close
docmd.openform "F_MainMenu"
end if
end if
end if
end if
The else function doesn't work. It regards the else as the 'no' and 'cancel' of the first message box!
Can someone help me please?
This isn't the full code! If you need it, please let me know!
Thanks
Rhys
I have a problem which has been bugging me for a while now, so thought I would sign up here to get it sorted! So here it goes.
I have a form with a close button on it. I have written a code for it which is as follows. (It has been condenced though)
if isnull (FirstName) and isnull (LastName) then
if msgbox "Are you sure you want to close? This record will not be saved", vbyesnocancel) = vbyes
docmd.runcommand accmdundo
docmd.close
docmd.openform "F_MainMenu"
else
If not isnull (FirstName) and not isnull (LastName) then
if msgbox ("Do you want close?, vbyesnocancel) = vbyes then
docmd.close
docmd.openform "F_MainMenu"
end if
end if
end if
end if
The else function doesn't work. It regards the else as the 'no' and 'cancel' of the first message box!
Can someone help me please?
This isn't the full code! If you need it, please let me know!
Thanks
Rhys