Switchboard Question

baba78

Registered User.
Local time
Today, 00:33
Joined
Jan 19, 2009
Messages
38
Hi,
I've just created a simple database from scratch and amnow in the process of creating a switchboard for it. What I'd like to do is create two command buttons to take you to the same form. One would take you to view existing records that have been filled in (each record represents details of an incident), the other would take you to a blank one to fill in ('new record', for example), which would be at the end of the existing files.
I know how to create the command buttons as i have already created the first one, but i can't seem to work out how to establish the second type.
Can anyone help?
 
in your code after

docmd.openform formname

enter a comma, (or press F1 help), and you will see various parameters

keep entering commas until you see the openmode

acformEdit lets you see old records
acformadd just lets you add new ones
 
Hi,
Where/how do i find this code?
 
Copy your existing command button, right click on the new command button and select properties. Click the events tab and you should see (Event Procedure) in the OnClick line next to this you will see a button with 3 dots click that this takes you to the VB code for that event.

In the code you will see what Dave has described then carry out his procedure to make the button do what you want :)

Good luck John
 
Thanks for this - i've got as far as the code page. I've attached what it looks like. I've been having problems knowing exactly where to put the commas as there already are some.
 

Attachments

As you have used the wizard to create buttons go to the onclick event of the button you are using and replace with:

DoCmd.OpenForm stDocName, , , acFormAdd

Unfortunately you have a few events un-named so don't know which one your using...

good luck John

PS. stDocName is the string set by the wizard which equals your: stDocName = "Accident Event Form2without boxes" as dave said you could just use your form name but as you already have set roll with it also study why it works VB is very syntax critcal one ,)# in the wrong place will give you something that won't work :)
 
Also, and i'm sorry to be a pain with these naive questions, I'm trying to establish some security on it so that i can issue users with log-ons so i go to tools and security and choose 'user and group accounts' but when i try to add a new user it says i can't because the object is 'read only' - how can it be if i created the darned thing??
 

Users who are viewing this thread

Back
Top Bottom