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 Replies


ADVERTISEMENT

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 hasSwitchboardID as: 3 (this button is on its own page)ItemNumber as: 1Itemtext as: Run Pending DeletionsCommand as: 8Argument 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 3 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

Switchboard Query

May 3, 2005

Hi guys,

I've got a form that shows the result of a query in datasheet mode.

However if I use a switchboard to open the form (and hence run the query) the results aren't in datasheet mode but in column mode.

How do I get the this query to display in datsheet view?

Thanks

View 2 Replies View Related

Add A Query To A Switchboard

Nov 8, 2007

hi i have a query that is connected with a form. Now i want to add that form to the switchboard, but i have to add the qry as the form doesnt work without the qry. so i was wondering if anyone knew how to add a qry to a switchboard??

View 2 Replies View Related

Can I Access A Query From A Switchboard?

Apr 14, 2007

I am trying to access a query from a switchboard. I see that the Switchboard Manager shows you only reports and forms - no queries. How can I run a query from a switchboard?

Robert

View 4 Replies View Related

Access Switchboard Command To Run Query

Oct 31, 2004

Hi!
I'm working on an Access file. I know how to create a swtitchboad and have it appear when the file opens. The switchboad will have three commands. The commands will be:

1. Open a form called "FORM1" in add mode.

2. Run a query named "Query1" so that it will run a query that is the only query in the file. The query only lists ten items of information entered in the ONE most recently completed entry in ONE table.

3. Close the switchboard and then close the file.

I know how to do the first and third commands. Does anybody out there know how to write the code, or the macro, or whatever it's called that will do the second one?
Thanks,

pfdjr

View 1 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

Re-opening 'switchboard' After Closing Crosstab Query?

Jan 12, 2006

I have a 'switchboard' form called Menu (not created by access wizard). One of the buttons down the navigation tree opens a crosstab query for the user to examine a data summary; but the 'Menu' form is still visible right in front of the query. Now, I could close the Menu form easily enough when the run query code is triggered, but that would leave the user loose in the database window when they eventually close the crosstab query window.

All that I have read on database navigation says that this is bad thing.

I can't place the crosstab query into a form or report because the column headings/fields don't appear when I try. (The field headings of the cross tab query are likely to change based on the underlying select query parameters so I can't hard-code the field names).

So, any thoughts on how to reactivate my Menu once the user closes the crosstab query or else puts the focus on the database window? (I achieve this using vba code in the on_close events of other forms and reports but I don't see an equivalent option for queries!)

Please note that I'm a vba newbie!

Thanks,
Craig

View 5 Replies View Related

Count On Query And Displaying Result On A Switchboard

Jul 31, 2006

Hi Folks

More questions from the newbie :eek:

I have a very simple table with a field that will have only the values open or closed

I created a query based on this table and used the count function (to count open or closed cases) and in the next querie field I used the group by open.

This gives me a count of all open cases

I can do the same for closed cases.

I want this count to be displayed on a Switchboard form but i cant get my nehad round how to get it there.

Can anyone help me out ?

Many thanks

Jimmy

View 6 Replies View Related

Running Sum In Query Possible?

Sep 16, 2005

Hi!

Sorry I am to bother you. But I was wondering whether it is possible to create a running sum in a query (from each previous record just a simple add up)?

I know how to do in report (it is described in the help function) but for a query I cannot find anything.

Thx and rgds,
Lobhaan

View 2 Replies View Related

Running Sum Query

Feb 16, 2006

have a table, Loans.

Fields:
ID (key)
Loan Number
Principal Balance.

I have another table, Transaction, that's based off the Loan Number field on the loans table.

Fields:
LoanNumber
Payment Type (2 choices, payment and advance)
Amount

I have a user form where users can specify the payment type, and amount, based on a certain loan number.

I'm attempting to do this:

User enters a transaction into the database. once the transaction is entered, the Principal Balance field for the specified loan number is updated.

If the payment type is advance, the query will subtract the amount from principalbalnce. if payment, the query wll add the amount to the principal balance.


Here's what I have so far.

The userform updates the transactions table with the information correctly.

My next step is to update the principal balance.

I'm thinking I could use some sort of update query, but I don't know where to begin.

HELP!!

If there is a better (normalized) way to accomplish this, I'm definitely open to ideas. Please just provide a basic example so I can understand. :o :cool:

View 1 Replies View Related

Running Query With Like In Ado

Jul 29, 2006

Well Shut down my computer and call me a newbie.

I'm trying to run an append query with two parameters and a like "value*" in the where clause. When I run it in ADO it returns no values.

When I run it in DAO is works just fine.

WHen I delete the like condition it works just fine.

When I change the like condition to and abolute condition, e.g. "Cancel" it works just fine.

BUT WHEN I PUT Like "Can*" back it is returns no records.

Now I've been working with Access for more years than I will admit, but I have never seen anything like this.

I assume Like is valid SQL

SO SOMEONE PUT ME OUT OF MY MISERY. Am I barking up the wrong dog, or is "Like 'XXX*" not usable when executing queries in ADO.

SAVE ME !!!!! SAVE ME!!!!

View 10 Replies View Related

Running Sum Query

Jan 7, 2008

Hi

I have a query that shows part numbers with a total qty ordered for a specified time period. This first part of the query is fine and is made into a table.

I am then trying to use this table to create a running sum with the list sorted in descending order, and ultimately break the list where the sum reaches 80% of the total qty across the whole list. I have tried the following formula and the table has been indexed in the descending order it would need to be in. The IndexAlias has also been created and made into a fixed table prior to running the 'Running Sum' query.


RunTot: DSum("qty_ordered","Core Stock","[Index]<=" & [IndexAlias] & "")


I have taken this formula from the microsoft link below, (Method 2), and adapted it to my query. However, although I have a decent understanding of Access I do not understand the '&' in this formula. Removing this and the double quotes on the end returns an error and leaving them in returns zeros all the way down the 'RunTot' field. If anyone can help I would appreciate it as I am stuck on this.


http://support.microsoft.com/kb/290136


many thanks


:)

View 14 Replies View Related

Running Sum In A Query

May 15, 2006

hey there,
i am trying to create running sum in a query. i found the function for a report but not i a query

From MS Access Help: ("You can number the items in your report by using a calculated control and the RunningSum property. First, you create a text box and set its ControlSource property to =1. Then, you set the RunningSum property for the text box. If you want the numbering to start over for each group, set the property to Over Group. If you want to accumulate a running sum for the entire report, set the property to Over All")

my overall goal is to number each Employees assignments that they have. That is Employee1 may be associated to 2 assignments, thus resulting in employee1, (assignment number) 1, employee1, (assignment number) 2, and Employee2 may have 4 assignments, employee2, (assignmetn number)1, employee2, (assignmetn number)2,employee2, (assignmetn number)3, employee2, (assignmetn number)4.

any ideas.

View 6 Replies View Related

Running Total In Query

Mar 12, 2007

Does anyon ehave any experience of running totals in an access query.
I'm reporting the data through excel not access reports so need a query not a report solution..

I have a table which looks:

RegionCategoryTypeDesc Period_IDPeriod_YTDPeriodTotal
CanadaEventsWSOP Team67Budget15000
CanadaEventsWSOP Team78Budget0
CanadaEventsWSOP Team89Budget0
CanadaEventsWSOP Team910Budget0
CanadaEventsWSOP Team1011Budget0
CanadaEventsWSOP Team1112Budget0
CanadaEventsWSOP Team1213Budget0
CanadaEventsTOTALAll12Budget15000
CanadaEventsTOTALAll23Budget15000
CanadaEventsTOTALAll34Budget15000
CanadaEventsTOTALAll45Budget15000
CanadaEventsTOTALAll56Budget15000

What I would like is to have an additional column which keeps a monthly summary of spend based on running total month 1to 12. All items have months 1 - 12 and are ordered in that fashion.

Any helpo really appreciated.

Simon

View 1 Replies View Related

Running Totals Query Help

Jun 23, 2005

Hi - Once again I'm asking for your assistance. Ideally, below is how the form (and eventually a report) would look; the first three fields (ID, Date & Vol) I currently have in a table (tblMaster):

ID Date Volume YTDTotal Q1Total CurrQTDTotal Q2Total
A1 Jun-05 10,000 77,000 40,000 37,000 37,000
A1 May-05 15,000 67,000 40,000 27,000
A1 Apr-05 12,000 52,000 40,000 12,000
A1 ------ ------ 40,000 40,000

(Sorry, I couldn't get the above data to line up right :confused: )

How would I build a query such that I could show the above in a form/subform (and eventually a report)? Help is greatly appreciated.

View 1 Replies View Related

Running More Than One Sql Update Query

Aug 26, 2005

I am helping a company reorganize its employee data to reflect recent changes in the company's organization. It involves a lot of data manipulation that, for the most part, can't be done programatically.

I can save a little time using SQL update queries like this:

update personnel set Department = "Support Staff" where Jobtitle="Shipper"
update personnel set Department = "Maintenance" where Jobtitle="Mechanic"
update personnel set Department = "Regional" where Jobtitle="HR Manager"

I have prepared a text file containing 530 such queries that can be pasted into Access. But as much time as that saves me, it is still a day or two of cutting and pasting.

What would be the best way to talk Access into running all the queries, without having to paste in every one individually?

Thanks...
...df

View 2 Replies View Related

Running Query With Macros

Dec 8, 2005

hi guys!

Is there a way to run a query with macros? I don't want to open it. I just want to run it, generate a report which will then be sent via email. How do I go about it?

Thx a mill!

cheers:D

View 1 Replies View Related

Running A Query With A Lot Of Records

Mar 9, 2006

I am running a query that has over 14000 records. What I tell the query to is read two other queries and tell me which record does not match with the other one. My problem is, that it takes over 10 minutes to do.
I have already compressed the file. I do not have a primary key (trust me on it, I can not do that). Are there any other ways to resolve this?

View 1 Replies View Related

Running Balance In A Query

Mar 13, 2006

I have a query that have three columns invoice number, tran number and amount. What I would like to do is to sum the invoice number if they are equal. example:

new column
Invoice #: 1345652 50.00 50.00
Invoice #: 1345652 65.00 115.00

I have the same invoice multiple times, but the transaction number is different. so I need to SUM all the invoices that are the same.


Please help!!!!!!!

View 5 Replies View Related

DSUM / Running Sum In Query

Sep 5, 2006

I have been trying to get this all night. This was my last attempt. I know it is all wrong and messed up but after 10 hrs I go for help. There is no date field to work with.

Expr2: DSum("[Amount]","[List]","[Item]=" & [Item] & "and [FinItem]>0")+0

But it ended up like this.

Item ------Location-------Amount--Expr2----Expr3
210090------030005 -------267470--error ----859103.74417
220170------ GYM -------409000--error ----859103.74417
220170------ 060010-------83297 ---error ----859103.74417
220170------ 050010-------17762 --error ----859103.74417
3429B -------060010-------0.74417--error ----859103.74417
3429B -------060010-------3 ----error ----859103.74417
7342900-----060010--------5369 ---error ----859103.74417
7342900-----060050--------76202 --error ----859103.74417


I need it to look like this.Where it will do a running sum based on the "Item" Groups.

Item---------Location------Amount----Expr2------Expr3
210090------ 030005-------267470---267470---859103.74417
220170------ GYM --------409000---409000---859103.74417
220170------060010-------83297----492297---859103.74417
220170------050010-------17762----510059---859103.74417
3429B-------060010------- 0.74417---0.74417---859103.74417
3429B-------060010------- 3-------3.74417---859103.74417
7342900-----060010-------5369----5369-----859103.74417
7342900-----060050-------76202---81571----859103.74417





Please Help.

View 3 Replies View Related

Running Count In Query

Dec 24, 2006

I have a query with 40 fields and 16,000 records. Field 1 is Location, of which I have 197 unique values. What I would like to do is have a running count for each unique location and when the location changes start the count over again.

Example

Count Location Function
1 100 1111
1 105 1111
2 105 1121
3 105 1131
1 110 1151
2 110 1151

I am using Order By to get the proper sort. In some other instances I may want the count to be dependent on the combination of Location and Function codes. Can someone provide some SQL tip(s) that would allow me to accomplish this.

Thanks

Loki

View 5 Replies View Related

Automatically Running Query

Jan 23, 2007

Behind a command button, i have 3 queries being run. 2 of these queries are append queries, copying the specified record into another table (criteria set to ID of the main form) and the other query is to delete the record from the current table once it has been copied. This is then followed by another delete (not query)

When each of these are run, boxes pop up asking if you're sure you want to do it. I was wondering if it would be possibly to bring up my own box to ask if the user is sure they want to continue, and when they click yes, all the questions that the query asks about wanting to do it, are automatically chosen as yes.

I.E there is only one option box, yes and no, and no others appear.

Is this possible, if so, how?

Thanks
Aidy

View 4 Replies View Related

Running Query About Date

May 9, 2007

Hello,
Say for example I have a database containing the date of birth of people in the format of YYYYMMDD (a string/text field) and another field about the age of the person (a numerical field) and another field is, say, the date they had their birthday last year. I would like to check whether the year in the date of birth field and age adds together is the year in the date they had the last birthday field (or off by no more than 2 years), and give me the list of the people who are not. Is it possible to do that by writing a query or I have to use a macro and write an SQL statement for it? In both case, how should that be done?

Thanks a lot!

View 9 Replies View Related

Running Total Query

Aug 22, 2007

Hi,

Am trying to create a query for a chart where I can total the employees over time but am having real trouble creating a running total from the "Total" field within a query but cannot seem to get it at all.

TotalStartDateLeftDate RunningTotal
126/03/1957
121/03/1971
127/02/1986
115/02/1988
207/03/1988
007/03/198831/05/2007

Here is my current SQL query:

SELECT Sum([CountOfStartDate]-[CountOfLeftDate]) AS Total, Atest1.StartDate, Atest1.LeftDate, Sum([CountOfStartDate]-[CountOfLeftDate]) AS RunningTotal
FROM Atest1
GROUP BY Atest1.StartDate, Atest1.LeftDate;


Can anyone help please?

View 5 Replies View Related







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