Link to home
Start Free TrialLog in
Avatar of andy98
andy98

asked on

form processing

I'm new to VB and MS access.
I want to create a form that when I press ok, the form is saved and when I press cancel
the form is not saved.
see the code below, it is not completed but this is all I came up
with:

intRes = MsgBox("", vbOKCancel + vbQuestion, )

Select Case intRes

        Case vbOK
               

        Case vbCancel
               
End Select



I want to know what should I write after " case vbok" and "case vbCancel"

Thanks...
Avatar of gilbertkid
gilbertkid

What form do you want it to save under
What form do you want it to save under
This is a lot of code for 50 points!!!
Avatar of andy98

ASKER

I have increased my points to 200 gilbertkid ...
All I want is to accept any data enterred in the form
if the ok button pressed or not to accept the data
entered in the form if the cancel buttom is pressed...
Lets see if you can help, I added 150 more points...

case vbOk:

   your code to save the data (to a file, database or whatever)

case vbCancel:
'do nothing, in both cases you will
'probably unload the form

end select

'unload the form
Unload Me
set yourFormsName = nothing
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It would be nice if you told us why an answer is rejected.

Do you want to save your data in a MSAccess database?