Welcome to E-Goat :: The Totally Unofficial Royal Air Force Rumour Network
Join our free community to unlock a range of benefits like:
  • Post and participate in discussions.
  • Send and receive private messages with other members.
  • Respond to polls and surveys.
  • Upload and share content.
  • Gain access to exclusive features and tools.
Join 7.5K others today

Any VBA programmers out there?

  • Following weeks of work, the E-GOAT team are delighted to present to you a new look to the forums with plenty of new features. Take a look around and see what you think!
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'
 
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,

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?
 
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!
 
Gimme a couple of days to fly back to my code library and I'll upload something for you. :PDT_Xtremez_28:
 
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.
 
Back
Top