i have a form that pulls in a subform specific to the CurrentUser(). It is meant to be a shortcut or favorites form that holds 8 command buttons. I have Dlookups on the form to pull the correct fields from a table for OpenForm or OpenReport and then the name of the form or report they want to open. My froms work but when i try and open a report, it just prints the (correct) report and does not open it. I just want to open it.
Private Sub cmdBtn1_Click() If Me.btn1Action = "OpenForm" Then DoCmd.OpenForm Me.btn1Details, acNormal, , , acFormAdd, acWindowNormal Else If Me.btn1Action = "OpenReport" Then DoCmd.OpenReport Me.btn1Details, acViewNormal, , , acWindowNormal Else End If End If End Sub
Hi, I need to write a stored procedure that sits between sql server and MS access. This procedure will make sure that the queries run in access against the data in sql server will not access data for more than two years back. This is so that the queries run against the sql server do not hang up the server for too long.
I've read the posts regarding not store calculations. However, I was told by IS to store the mileage IRS deduction as it changed 3 times last year.
Any idea's how to handle this? I need the table to remember how much $$ was paid out in mileage expense. I had set up a field called mexpense and mileage, where =[Mileage]*0.375.
I apologize that I am not a very good VBA programmer yet but I'm really trying....
I am attempting to calculate a value by adding two fields and storing the result into a third field - - My code only works if both of the fields are not null.
Private Sub PartialDepositAmount_AfterUpdate()
Dim PartialDepositAmount As Currency Dim FinalDepositAmount As Currency Dim DepositAmount As Currency
I have an Access mdb that has a bunch of tables linked from a SQL Server. On the SQL Server I have some stored procedures that do inserts into various tables. In the Access db I have some local (lookup) tables, queries, and other things that for various reasons can't/don't need to be stored in the SQL server. I'm using Windows authentication to connect to the SQL server because the security is managed through our domain.
I want to write a form that has unbound text fields that, when I submit the form passes all of those values as parameters to a stored procedure in the SQL server. I have written just such a form in an .adp file, which handles the integrated security nicely.
However, I'd rather do this in a regular .mdb file. I've read up on how I can use an ADO connection to do this, then create a SQL string to EXECUTE the stored proc, grab all the values off the form, and build the SQL.
But the problem with this solution is the authentication - I can't use the SA user and password in this connection string, I'd have to utilize the logged-in user's information.
Is there an easier way to execute the stored procedure from an .mdb? Using the integrated authentication?
Failing that, is there a way that I can create "local" (to the .adp) tables, queries, and so on in an .adp?
I come from a SQL Server background and am very familiar with store dprocedures and input parameteres.
Is there a way to use a similar method in Access. or example, passing parameters from a button on a form to a query, which can change depending on the input parameter? If so, how ?
Also, how much scope do you have in this for running SQL IF statements and such in the query? It seems that many Access queris can only have one statement at a time.
I'm running a access 2000 adp front end working from a SQL2000 database. I've got a sproc P_insertsessions i can get this work from a cmd button on a form but i'm having problems setting the paramerters i want it to use controls on the form. @contractid = contractid @start_date = startdate @end_date = enddate @hours = duration
Sometimes when I send a copy of an Access 2003 application to a remote user, a stored procedure or function will disappear. What causes this, and how can I get the entire application over to the users?
I have combo boxes on a form which are pulling values from a one table and being stored in another table. However they are being stored as '1' or '2' in the other table once selected on the form, as instead of being stored as their literal values ie 'car' or 'van'. Is there any way of making this happen, as it makes reporting a nightmare! Thanks in advance...
Is there any way to count how many lines of text are stored in a particular table field? How about counting how many times was the "enter" key pressed?
I have and access form that has a list box with dates in it. I need to pick a date and then run a stored procedure in SQL based on that date. Can someone help me with the login to pass on the date?
So if I have listbox1 which is a list of dates from another table and my procedure is simply
select * from main where date = *******
How can I pass the list box value to the stored procedure? My procedure works with WHERE date = (SELECT(LEFT(GETDATE(),11))) but I have since learned that todays date will not always be used so I need to pass a value.
I'm working on and Access 2003 front end with a SQL Server Back End. I would like to take advantage of the speed of Stored Procs to populate a list box on a form. Here's the code I'm trying to use.
Set cmd = MakeStoredProc("StoredProcName") Set prm1 = cmd.CreateParameter("ParamName", adInteger, adParamInput, , Me![ID]) cmd.Parameters.Append prm1 rstSource.CursorLocation = adUseClient rstSource.CursorType = adOpenKeyset rstSource.LockType = adLockOptimistic Set rstSource = cmd.Execute
Me![ListBox].Recordset = rstSource
Access doesn't like this. What is wrong. I get the message "Object doesn't support the property or method"
Sorry if this is an easy one and I just missing it, but I have a form in an Access2003 database with option groups for ratings for 18 individual tasks ie: Safety: 1. Satisfactory 2. Marginal 3. Unsatisfactory 4. N/A The value stored in the table is 1,2,3, or 4 for each one, obviously. How can I change the stored value in the table to "Sat" "Marginal" "Unsat" etc? Or, if easier, make the report convert the numerical values to names?
Im having some Major issues with this problem, i only hope someone can help me!!
Firstly, let me set the scene. I have 1 Form, And 1 Subform within that form. The form gets the Main Data, the SubForm gets all the Related Data (in this case, its all the Items Of Equipment this client has) and then lists them in the subform. So it could return 1, or it could return 20 records.
What we want from this is to be able to record what the client thought of the piece of equipment, so there is a Option Group on the SubForm, which allows the user to choose 1 of 6 options saying whether it was useful or not and things.
BUT here lies the problem, if the SubForm has returned 20 records, i change the OptionGroup on record one, and every other 19 records become the same. if i change Record 2, record 1 and 3 to 19 are the same.
I want to be able to have a seperate choice for each record returned, but tis not working!!
The subform is populated by calling a SQL SP, i cant set the form to link directly to a view or SP because access doesnt allow me, by saying the recordset is not updatable!
Hello, can we create a stored prodecure in Access 2000 and call it from VB. I've created in SQL Server with ASP but have no idea in Access. Can anyone please tell me how to do it. If so kindly specify some resources from where i can learn more related to this. thank you.
Not sure which forum this was under, but I figure Access might be it
I have a stored procedure already written which works fine, if I supply the criteria to it before or at manual execution. I want it to use a field on a form in an Access Data Project as it's criteria (as a form is built off the results of the procedure). I can't find any documentation on how to pass criteria to a stored procedure for use in SELECT WHERE statements.
Can somebody point me in the right direction? Here is my stored procedure:
When i execute this manually I get the dialog prompt to enter the value for @parHomePhone, which is what I want to automatically pull from txtPhone on the frmSearch form.
I would like to run a report that uses a stored procedure with parameters. Is there a way I can pass the parameters from the report to the stored procedure? I am NOT running it from a form.
I want to call the report from VBA code and pass it the parameters that are necessary to run the stored procedure. Any ideas?