• Welcome to the E-Goat :: The Totally Unofficial RAF Rumour Network.

    You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

    If you have any problems with the registration process or your account login, please contact us.

Any VBA programmers out there?

Weebl

Flight Sergeant
1,895
0
0
I need a little programme to save and exit on the push of a button on a form in MS Access.

Anyone help?

Access as a database saves constantly as you input information anyway. I cannot see you needing a button to save and close, just close? Everything you have already typed into the relevant fields will already be 'saved'
 

SirSaltyHelmet

Thoroughly Nice Chap
4,329
0
0
Weebl,

The reason I need it is that I need to run some code to return all the command bars before exit, the exit is the hard bit after running the code.
 

Weebl

Flight Sergeant
1,895
0
0
Weebl,

The reason I need it is that I need to run some code to return all the command bars before exit, the exit is the hard bit after running the code.

I take it you know how to make a close button then and just need the close code to tack on to your existing code?

I am pretty sure DoCmd.Close is all you need.

I think I get what you mean about the save thing in that case as well. If you use the above code then you will save as normal, but if you have had an error it will force close without saving rather than warn you of the error.

Is that what you mean?
 

SirSaltyHelmet

Thoroughly Nice Chap
4,329
0
0
About to drop kick this. I need a program to run on the splash screen load that gives me full screen and no command or toolbars using access.

HELP!
 
T

The Masked Geek

Guest
Gimme a couple of days to fly back to my code library and I'll upload something for you. :pDT_Xtremez_28:
 

Life-Is-Good

SAC
Subscriber
195
0
16
About to drop kick this. I need a program to run on the splash screen load that gives me full screen and no command or toolbars using access.

HELP!

Try this:

The below code will hide ALL menu bars and ALL tool bars. Ensure that you have a way to unhide the menu bars and tool bars before you hide them! You should place the hide all tool bars routine in your opening splash screen form for it only needs to be run once when the db is first opened.

You'd run this with your Splashscreen:
This will hide all menu bars and tool bars
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i

This with your Close button:
This will unhide all menu bars and tool bars
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = True
Next i

Source here

I have used the site plenty in the past for help.

I assume you are using your splash screen as the Form to open on Start-Up?

Hope that's of some help.
 
Top