Running A Sub From Switchboard

Dec 11, 2007

Hi there!

I am having a fair amount of trouble figuring this out, and I was hoping someone might know what I was doing wrong. Someone set up a switchboard (I think using the Switchboard wizard) in this Access DB. I've since taken on the project of automating a database process and I want to use a switchboard item so it's a one-click, otherwise mostly automatic process. I have added the switchboard item, and when I click on it I get a msgbox displaying with my test text, so I think that is set up OK.


Right now, I am trying to have a click on the button launch a custom sub (that I still have to write). Right now all I have in that sub is another call to a Msgbox with other testing text.


Following is the relevant VBA code - not all of it, but I think this is all that will be involved. runDeletions() is located in its own module "Module3":

The Sub:Public Sub runDeletions()

MsgBox "testing - runDeletions ran successfully"

End Sub


This is the code in the switchboard form that deals with the arguments taken - and that will call the above function. Code within Private Function HandleButtonClick(intBtn As Integer):


'...have the argument set to 8...
Const conCmdRunCode = 8

'... so this Case will run:
Case conCmdRunCode
' optional, just tells me the value of the argument being used
' MsgBox rs![Argument]
'actually is what tries to call the Sub
Application.Run rs![Argument]


I've found the Switchboard Items table, and added in the following record. It has
SwitchboardID as: 3 (this button is on its own page)
ItemNumber as: 1
Itemtext as: Run Pending Deletions
Command as: 8
Argument as: Module3.runDeletions()


I'm pretty sure my Argument is wrong. I've tried a few things but can't figure it out. What could I use as my Argument so my sub runDeletions in my module Module3 will run when this button is clicked?


Thanks!

PS - I've also posted this question here: http://www.vbaexpress.com/forum/showthread.php?t=16611 and any differences in code are intentional, as I keep trying different things (but so far no luck)...

View Replies


ADVERTISEMENT

Running A Query From A Switchboard

Jan 21, 2008

I have an SQL query which simply deletes any blank records from a table. I want to put it on a switchboard menu, but cannot see an option to do that. How do I do this? Perhaps create a little form and put a button on it to run the query?

Robert

View 1 Replies View Related

Linking From Switchboard To Switchboard On Two Or More Databases

Nov 21, 2006

I am working on a database that will be an addition to an existing one on the company server. However, to make the overall layout not so complex and allow room for other additions in the future, I'd like to keep the databases separate. This will also ensure more efficiency, integrity and troubleshooting overall.

I have the original database with the name of "Cell MFG Screen" that contains a switchboard. I am now creating a db to keep track of manufacturing waste (which will also be on the same server when completed). That switchboard is called "Cell Waste Weight". Again, I want to keep these db's separated from one another as well being able to add future dbs. Now, what my plan is to make up a one db that consists of only a switchboard that will be used as the main switchboard to be able to navigate to other dbs that are located on the server.

Does anyone know how this is done?

Thank you in advance for your help,

~Kilch

View 10 Replies View Related

Running Balance As Opposed To Running Total

Mar 14, 2005

Can anyone tell me how to get a running balance on a report. I know how to create a running total, by setting the "running sum" property of a text box to "Over all".

I can't however see how I can adapt this to give a running balance (as in a bank statement for example). Attempts to do so end up in failure!!

Many thanks in advance.
Peter

View 2 Replies View Related

Switchboard

Apr 14, 2006

Hi All, looking for some help.

I am looking for a way to link a help file to a button on the switchboard. I have several pages that all work well and open up the required forms and reports but I would like to add a help file to a button. Any idea would be appreciated thanks Williebear.

View 3 Replies View Related

Switchboard

Aug 10, 2005

hi everyone,

I am new to MS Access. I've created a database and now i want to add a switchboard to launch whenever i open the database file. i created the switchboard form and table following the access help. but i can only view the switchboard when i manually open the switchboard form. can anyone tell me how to make the swithboard launch automatically? i'm using access 2003

thanks

View 1 Replies View Related

Switchboard

Nov 14, 2005

I have a main switchboard, with a few Open Form command buttons on it, but what i would like to have is another button to bring the user to another switchboard screen giving the option to open a few Reports (obviosly the button on teh main switch board would read "Report Section), can this done, and also how would i go about putting Back or forward buttons withing the second (report Section) screen so the user can nav. to back to the main screen?

Thanks

View 2 Replies View Related

Switchboard Help

Dec 12, 2005

All,

I have created a new switchboard but don't know where it is. When I create it using the Switchboard Manager and then click close, it doesn't appear under any of the options. I have also set is as default but it fails to appear on startup.

Silly question I know. Any ideas?

Many Thanks

version: MS Acess 2003

View 8 Replies View Related

Switchboard

Jan 10, 2006

Was wondering how one might go about creating a swithboard similar to the Northwind one found in the sample database. Thanks

View 1 Replies View Related

Help With Switchboard

Jan 31, 2006

Brief Summary,

I have limited experience in Access but have a bit more understanding of databases and tables. I am helping a friend create and access database to track the time his employees spend on different job sites. i am using a template from Microsoft called "Time and Billing" I am going to be manipulating the structure a bit but other than that the template should work fine.

My main struggle is I need to have a screen that the employees access that takes them straight to add / edit a time sheet. i want the rest of the data, reports, views to be password protected. Ideally the switchboard would load up to a page that had a button from employees to click on where they would be taken to the form and a button the owner could click on, enter a password, and be taken into the back-end where the main switch board and the rest of the data resides.

If anyone can help me out that would be great. Oh yeah, The Access database in is Access 2000 being used on a machine running XP Pro.

Thanks in advance for your help.

Gary

View 1 Replies View Related

Switchboard....

Feb 22, 2006

Ok, so I will sound like the dumbest person but essentially what is a switch board?

I have searched this place I have searched google but no luck, all I get is that its a menu to navigate, so basically a form with buttons that open frm's qry's etc... I have made a main menu with a basic form so whats so special about a switchboard.

Cheers

View 2 Replies View Related

Switchboard

Mar 13, 2006

I have two queries. I have a delete query and an append query. Is there anyway that I have these two queries run on a switchboard.

View 4 Replies View Related

Switchboard!

Mar 15, 2006

Help - I made a switchboard and it went wrong, so deleted all of the sub switchboards and the switchboard icon in the forms window.

I have now made a new one, but I can't get it to appear in the forms window.

Any ideas?
Shellie xx

View 2 Replies View Related

Switchboard

Feb 26, 2008

Hi

Can anyone tell me what the advantage (or difference) is in using a switchboard rather than just creating your own form and using command buttons etc?

Thanks

View 3 Replies View Related

Switchboard

Apr 9, 2008

When I make a switchboard is there any way you can go to a table? or can you just go to a form or query? and when you make a switchboard and you have a button going to the form how can you go from the form back to the switchboard?

View 8 Replies View Related

Switchboard

Feb 24, 2005

hi,

I've made switchboard. and change the properties of switchboard, namely the "don't show the menu bar". can anyone please explain to me, how to get it back?

in opposite case, I can kiss my db goodbye, for i can't make any changes into switchboard? or??

thanks a lot,

peace

View 4 Replies View Related

Switchboard

Mar 17, 2005

I think this is a simple request for those who know.

I want to display my switchboard to a user group, (read and update ).

The switchboard needs to be full screen and have no means of being minimsed or close, except by the exit button (obviously) on the switchboard.I also do not want to show any of the tool bar icons as well.

I want to retain it as it is now to me as 'admin' when I log in, that is with the ability to minimise and close etc.and all icons

How do I achieve this?

View 1 Replies View Related

Switchboard Help

Jul 7, 2005

I would like to know if there's a way of adding a switchboard page that goes to a table instead of only forms and reports and such? Because I have subdatasheets that I would like to see when I click on a button from the switchboard, instead of just simply going to a form and not being able to work as easy as it would be to work with a table that displays the subdatasheet right there.

Thank you,

Charlie

View 2 Replies View Related

Switchboard

Nov 10, 2005

I have copies of a split database (front end) placed on each employee’s computer, and I noticed my switchboard screen does not appear when the employee opens the database on their computer. I went through a lot of work designing the switchboard and would like to have it appear upon opening the DB. I know everything in the database is linked so there is no reason the switchboard should not appear. Any suggestions on how to make this happen?

In addition, I have pictures on the switchboard buttons, and I also noticed when I go to the second screen, the buttons on the second switchboard screen uses the same pictures as the default screen. Is there a way to not have it do that?

Thanks.

View 1 Replies View Related

Switchboard Help!

Aug 21, 2006

hi guys i am working in customizing my current switchboard and i was wondering if there is any way to hide a button according to a user.. i currently have a tblusers with the username, switchboardid and itemnumber i want as a default, but i would also like to have a certain itemnumber to be hidden, is that possible?

this is the code i have in my switchboad and it works fine:

Private Sub Form_Open(Cancel As Integer)
txtUser_Name = GetUserName()


Dim intItem As Integer
Dim intSwitchbd As Integer

intItem = Nz(DLookup("[ItemNumber]", "tblusers", "[Userid] = '" & Me!txtUser_Name & "'"), 0)
intSwitchbd = Nz(DLookup("[SwitchboardID]", "tblusers", "[Userid] = '" & Me!txtUser_Name & "'"), 0)

Forms!Switchboard.Filter = "[ItemNumber] = " & intItem & " And [SwitchboardID] = " & intSwitchbd
Forms!Switchboard.Refresh
Me.FilterOn = True



any help will be apreciate it!!!

View 3 Replies View Related

Switchboard

Dec 11, 2006

How can I add more buttons on the built-in switchboard that only has 8 !!!

Thanks

Marco

View 2 Replies View Related

Switchboard

Feb 19, 2004

the switchboard on my database doesnt automatically appear when i open the database file. how do i make this happen.
thank you.

View 14 Replies View Related

Switchboard

Feb 28, 2005

I have created a very simple switchboard with a few macro's to run either a form to add new records or a report based on a query.

Thing is, when I try to open the switchboard, I get a module error...

Since I'm really just using trial and error to create this entire database for a schoolproject, I don't know that much about access.

Anyone here able to help me out?
If more info is needed to answer the question, plz let me know so I can try to provide it...

Thx in advance,

Lion85heart

View 7 Replies View Related

Switchboard

Mar 13, 2006

I have two queries. I have a delete query and an append query. Is there anyway that I have these two queries run on a switchboard?

View 2 Replies View Related

Switchboard Help

Feb 20, 2007

First time post

I have a database to track course info.
I am having problems getting my default switchboard to open a 2nd switchboard.
It shows the 2nd switchboard, but when u click it does nothing. Any tips??
Thanks

View 2 Replies View Related

Switchboard Help!!??

Jan 22, 2008

Hey, I've created a database and want to add a switchboard to it but it keeps coming up with an error message saying that a query name is either mispelled or doesnt exist, i've renamed it but it still comes up with that error message, and telling me to delete/rename it in a macro, i've tried this (only a novice so dont know if im doing it right) but the error message keeps coming up, it allow's me to press ok (have to press it 4 times!!) and to create the switchboard but when i go to view the switchboard it just comes up 'module not found'. If anyone has any idea whats going on i'd really appreciate it, cos im really stuck! cheers!

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved