General :: Saving User Defined Variables

Sep 16, 2012

I have a database that creates many forms based on queries which are based on user-defined variables. These are permanent variables added directly in the query, such as "if an employee is late 4 times in a month, we yell at them." I would like to be able to change this to "5 times in a month" if the users want to.

Rather than waiting for that to happen and having to change all my queries, i want to set up a form for them to access and edit the variable, save it, and then my queries to reference that variable.

My question is what is the best way to store and reference them? I could create a table, but i am not too sure how easy it would be to make my queries work with that.

I could also add them onto my main form which is always open, but I'm not sure how to make them save when access is closed. (a quick trial from my variable form won't let me update either a text box or label value on the main form).

View Replies


ADVERTISEMENT

General :: ADODB Connection - User Defined Type Not Defined

Feb 10, 2014

I have a line of code in an old program:

Dim CN as ADODB Connection

This is giving me the error 'User defined type not defined'. I know I have to set something in a list somewhere but have forgotten how to do that. Where to go, and what to set?

View 1 Replies View Related

Modules & VBA :: Compile Error - User-defined Type Not Defined

Apr 20, 2015

I copied some VBA from one database to another. I didn't change anything and I am able to run it fine in the first database. But in the DB I pasted it to, I am received a Compile Error message with the XlApp As Excel.Application area highlighted.

Function OpenAutoCount()
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook

[code]...

View 3 Replies View Related

General :: Setting Printer Paper Size To User Defined

Feb 18, 2014

I want to set my paper size to user defined, but it not working,

<<<<<<<<<<<<<<<<<<<<<<<<<<
Set Application.Printer = Application.Printers("P1121E")
Application.Printer.PaperSize = acPRPSUser
Application.Printer.ItemSizeHeight = 9.35 Application.Printer.ItemSizeWidth = 26.9
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Showing "Run time error "2595"

"Cannot set this property when defaultsize property is set to true"

I try add "Application.Printer.Defaultsize = true or false" also not working

View 1 Replies View Related

General :: User Defined Function Exports Julian Date

Jan 10, 2013

I have created user defined function for lastdayofweek, lastdayofmonth, and firstdayofmonth. When I apply this function to an expression in my query, it returns a julian date. How do I apply the format for the calendar date?

Maybe I am not calling my function correctly. Here's my functions below as well as my expression..

Function LastDayThisMonth()
LastDayThisMonth = DateSerial(Year(Date), Month(Date) + 1, 0)
End Function

Function FirstDayThisMonth()
FirstDayThisMonth = DateSerial(Year(Date), Month(Date), 1)
End Function

[Code] ....

View 3 Replies View Related

Error - User Defined Type Not Defined

Nov 9, 2005

Hi,

On Compiling my assecc database VB code I get the following error message "User defined type not defined". I understand it is beecause I have not declared the Variable Type, but have no idea to exactly which part of the code the error is referring to.

How do I find out WHICH User defined type is not defined, especially when I have not got any (or do not want to use any) user defined types?

Thank you in advanced programming wizards. Kind regards, Adam.

View 14 Replies View Related

User-defined Type Not Defined

Oct 15, 2004

Dim XL As Excel.Application

When I try to run this specific line of code an error occurs. It says:
"User-defined type not defined"

May I know how to solve this problem?
Thanks a lot

View 1 Replies View Related

User-defined Type Not Defined

Sep 27, 2005

I've put in this in a module many times and this is the first time I have gotten an error.

Dim Conn As ADODB.Connection

When I run the app I am getting a compile error saying "User-defined type not defined".

Anyone have any ideas?

Thanks,

B

View 3 Replies View Related

General :: Capturing And Saving User Name Who Created And Updated A Record

Jul 20, 2012

I have taken the Access Tasks template and modified a bit. It now captures and saves the time and date a record is modified. The database is on a network folder and is shared among our team users.What I would like to do next is make it,

1- capture and record on my Tasks table the user name of who created the record by using the fOSUserName() function. I have the table fields "Created by" and the VB code in a module. This would happen only once when the record is created.

I would also like to do this with the machine name for which I have the module too. fOSMachineName()

and,

2- capture and record the user name of who modified a record. For this I also have a field in my task table "Last Modified By" and i hope i can use the same fOSUerNmae() function.

I got to the point where I put an unbounded text box with the =fOSUserName() in it and it does show the user name but how do i get to record to my task table?how the template removes the tasks that are completed from the task list as soon as it is updated to completed? how can I make this happen with a cancelled option after I add it to the drop down list?

View 3 Replies View Related

General :: Saving Program To Current User Documents Folder?

Aug 31, 2014

I have an access program and i want it to save a copy into a location... ive got it so it can save however - i want it to save to the current users documents folder (win 7)

What file path would i use?

View 5 Replies View Related

Tab Order - User Defined

Jun 16, 2005

Has anyone ever produced a function to let users, pick their own tab order for a form.

I am thinking along the lines of holding a tab order for each user for each form.

So when a form opens - if a user has saved a tab order the form will adopt it, if the user has never saved a tab order, the sytem default will be applied.

Would this work.

Paul

View 4 Replies View Related

User Defined Autonumber

Oct 31, 2005

Can anyone help?

Is it possible to have an autonumber that is generated depending on the entry in a particular field? I'm creating a database to track various enquiries and I would like each enquiry to have a unique number that is preceded by a codenumber that identifies its origin. For example:

ABC query - 100xxx
DEF query - 200xxx
XYZ query - 300xxx

(xxx denotes the autonumber part)

This way a particular query can be identified just from its number without having to interrogate the main record.

Can it be done? I've searched other posts and not found quite what I'm looking for.

(If not then no probs - I'll think of another way!)

Thanks in advance

View 2 Replies View Related

User Defined Query

Sep 2, 2004

I have a combo box that the user can select a value and the form will display that record on the form. This all works fine, but if the user dosn't enter anything in the combo box, it does not work. Is there a way to have it work if the combo box is left empty?
Thanks in advance - John

View 1 Replies View Related

User Defined Tables

Nov 2, 2004

I am trying to get the list of all user defined tables from the Access database.

If I use the following query in Access it's working fine and getting the result. But if I am trying to execute the query in ASP page, it's not working. I am getting an error ([Microsoft][ODBC Microsoft Access Driver] Record(s) cannot be read; no read permission on 'MSysObjects'.)

Can u please tell me the reason.


SELECT MSysObjects.Name AS TableName
FROM MSysObjects
WHERE (((MSysObjects.Type)=1)
AND ((MSysObjects.Flags)=0));

Note: If you have anything, to extract user defined tables, please tell me. Either one works out for me.

View 3 Replies View Related

User Defined Dates Into A Report

Oct 3, 2006

HI,

I have a query [CustomerOrdersByDate] that requests user input for [CustomerID], a 'Start Date' and an 'End Date' for the [OrderDate] field.

the Report works fine, however I'd like it to be able to take the Start & End dates the user has inputted when running the report, and make it appear in the Report header
e.g. Orders Received from [CustomerID], Between {user defined}[Enter Start Date] And {user defined}[Enter End Date].

I have added a text box to display the results and played around with a few different expressions, etc... unsuccessfully so far, and as I'm not up to working with VBA code, I would appreciate some help!

View 2 Replies View Related

User Defined Query/ Report

Feb 7, 2008

Hello,

Is there any way of creating a user defined query/ report based on fields in a table? Basically we want a report to be generated based on whatever fields the user enters. So, say we have 30 different fields in a table, the user gets to click on a button that gives them the option to create a report that includes: field1, field2, field3 and where field10 = Blue.
Is this possible to do?

View 1 Replies View Related

User Defined Date Query

Apr 16, 2008

I want to run an activity query (i.e. objective is to check which data lines have changed) within a user defined date range. Please advise what is the most efficient way to achieve this.

Is it possible to run such a report without having a date column i.e. does Access have a hidden line modification date that can be used in a search?

Look forward to your feedback - thanks!

View 2 Replies View Related

User Defined Date In Queries

Apr 17, 2008

Hello all, im new here so hi to everyone.

Im stuck! I am pretty much a novice when it comes to access and have been given the task or creating some reports to stop us doing it manually.

Within a query, I have a date column which we would currently enter the following into the criteria:

Between #01/01/2008# And #31/01/2008#

for the month of January.

What i want to be able to do (and i know is possible as ive done it in the past but cant remember how) is have a pop up when the query is ran to enter the Start date and End date. I remember it being something to do with square brackets but cant get it to work.

Help please! lol

View 14 Replies View Related

Creating Reports From 3 User Defined Critera

Nov 16, 2004

Please advise, how do I set up a form for this:

Based on one particular report style, have multi select criteria to produce user selected criteria

based on selections from a. Interest, b. State, c. Type

Report 1. sorts on Interest, 2. sorts by State, 3. sorts by Type ... and each report includes selections of the other 3 selections plus basic data common to all.

Plus, the Interests have a table where the main interest data is stored in a ContactInterest table, while the specific interest selections, per contact, are stored in the Contact table as Interest_1 through Interest_20.

In the Report, when it is sorted by Interest, while I have a concantated output for 5 of the selections, they also, want to sort alphabetically by the interest selections (which changes per Contact).

There is already a form for printing reports that are more static, and I wanted to add these selections on that form, perhaps as a subform, to allow printing of the reports, mentioned, and associated mail labels to the targeted addresses per group.

Any help, direction, guidance, or redirection would really help and is MUCH appreciated. I've tried many options, and as a newbie, have not yet found a solutions- or solutions.

Thank you so much. (time is of the essence and my skills are small so far.)

__________________

View 1 Replies View Related

Query Variables Controlled By User

Apr 11, 2008

I've created a rather simple Access program that I use to import an employee's cookie summary txt file. I then sort the cookies for 1) time of day, and 2) appropriateness.

I found a way to create the queries - in simple design mode using criteria - but I want system administrators in other offices to be able to enter the time of day variables particular to their offices. Same with appropriate words. So I want a form they can use to do that - eg, list their office's break times. In essence, a setup page. Then the resulting queries (time of day and word list) will be customized to the particulars of that office rather than to mine.

Would appreciate some ideas on how to do this. Should I read up on SQL? Should I learn VBA? I'm trying to get around having to tell the other system administrators to go into each query and change the criteria manually.

Thanks!

View 6 Replies View Related

User-defined Datatype In A Sql Server Attached Tables

Dec 5, 2006

Hi all,I'm trying to attach some table from a Sql Server database, but when I take a look to the content, I see all the fields filled by the value "#CANCELLED".I supposed that the matter of such an issue could be the datatype used for some fields, a user-defined datatype. The only table content from the same Sql Server database I can see does not use that data type. I'm using a read-only account to access the Sql Server database. If I try to import the table, the data are imported correctly and the user-datatype is converted to text.Any suggestions for a solution / workaround ?Thanks Bye

View 4 Replies View Related

User Defined Types/public Function In A Query

Oct 29, 2007

Hi All

I have used Allen Browne's code (see http://allenbrowne.com/ser-16.html, bottom of page) as a model for my user-defined type and public function in an events management database.

Using the function in forms/VBA works fine.

But my DB crashes whenever I try to use it in a query.

My modules code:
= = =
Option Compare Database

Public Type EvCheks
EvType As String
EvAttCat As String
EvUnitAss As String
EvCheksAll As String
End Type
= =
Public Function getEvCheks(EV, EvUnit) as EvCheks

'Event Type: Event or DL
If (DLookup("evtype", "tblevents", "[evid] = " & EV)) = "Event" Then
getEvCheks.EvType = "Y"
Else: getEvCheks.EvType = "N"
End If

'Event Attendance Category: INDB= in database or LIST
If (DLookup("evattcat", "tblevents", "[evid] = " & EV)) = "INDB" Then
getEvCheks.EvAttCat = "Y"
Else: getEvCheks.EvAttCat = "N"
End If

'Event Assessing Organisation
Dim AOROName As String
Dim AOName As String
AOROName = DLookup("evunitassessable", "tblevunits", "[evunitid] = " & EvUnit)
AOName = Mid([AOROName], 1, InStr([AOROName], "/") - 1)

Select Case AOName
Case "NA"
getEvCheks.EvUnitAss = "N"
Case "ABCD"
getEvCheks.EvUnitAss = "Y"
Case Else
getEvCheks.EvUnitAss = "X"
End Select

getEvCheks.EvCheksAll = getEvCheks.EvType & getEvCheks.EvAttCat & getEvCheks.EvUnitAss
End Function
====
On a form, I have a button with on-click event code that defines the EV and EVU variables and displays a message box
MsgBox getEvCheks(EV, EVU).EvCheksAll

This works fine.
=====
In a query I have this SQL code:
SELECT tblEvUnits.EvId, tblEvUnits.EvUnitID, getevcheks([evid],[evunitid]) AS EventDetails
FROM tblEvUnits;

This causes the db to crash.

I cannot get the "back-end" definition of the function into the query, as Access rejects it because of the dot, i.e. ".EvCheksAll".

I suspect there is some formatting quirk for using a public function that includes a user-defined type, in a query.

Any/all assistance much appreciated.

Regards
AlanM

View 3 Replies View Related

Queries :: User Defined Criteria On Percent Field?

May 7, 2013

I have a a table that stores various financial information such as sales receipt totals and variance totals (if actual cash in drawer did not match receipts, etc...) that I use to track cashier performance and identify possible problems. Part of this process includes a query that I pull reports against.

One such query, simplified to illustrate the concept, lists the dollar total that their receipts indicate they made, and the dollar amount that their actual drawer was off (either short or over what they should have taken in.) In this query I added fields that total Netsales (calculated from the first two fields) and another that calculates the percentage the variance is compared to their NetSales. The SQL behind the query is as follows:

Code:

SELECT tbl_OSRImport.Receipts, tbl_OSRImport.OverShort, [Receipts]-[OverShort] AS NetSales, [OverShort]/[NetSales] AS VarPerc
FROM tbl_OSRImport
WHERE (((tbl_OSRImport.OverShort)<>0) AND (([Receipts]-[OverShort])<>0));

This query works just fine. The calculated fields correctly display their results. The issue presents itself when I try to build a method for a user to run a report to see all the cashiers whose Varience Percentage (VarPerc) is equal to or within a range they specify. This allows the user to see all the cashiers who, for example, are more that 5% over or short. I have tried a number of criteria expressions in the query, with no success. I have gotten everything from a prompt asking me for paremeters to an error stating "Stack Overflow." I believe the problem has something to do with the fact that the numerical value that is calculated is a long string of numbers ending in letters and characters, which the Query displays as a neat and tidy Percentage. Below is an example of the data that I hope will explain this:

In the Query, the expression is: VarPerc: [OverShort]/[NetSales]

When the Query runs, the full numerical result is: -4.27103159497526E-02

Which visually is output as: -4.72%

Mathmatically (on a calculator using the same values) the equation is as follows:

-11.22 / 262.70 = -0.04271032

I think my attempts are failing becaue the query is trying to compare the user's input of (for example) 5, .5, .05, etc.... against the numerical value in the query result that includes the E-02 (above example.) So, rightfully it comes back with no results or an error.

View 5 Replies View Related

Queries :: User Defined Criteria For Number Field

May 28, 2015

Query that I have built to create a subform on one of my forms. It's my goal to make the subform easily navigable/query-able for the users, and that is where I've hit a roadblock. The subform contains a field - Balance - which I would like users to be able to search based on numeric/mathematic expressions (i.e. >0 and <40). In testing I have created a text box on the main form (BalanceCriteria), and linked it to the subform's balance field through the query in the Criteria field (forms!MainForm!BalanceCriteria).

This works fine with exact numbers - entering 19 will return client's with a balance of 19 - but returns an error - "Expression is typed incorrectly or is too complex to be evaluated" when tested with a numeric equation (>0).

View 3 Replies View Related

Queries :: Can Retrieve Value Of User-defined Type In A Query

Aug 19, 2013

Is there a way to retrieve the value of a user-defined type in a query?

Here's the type:

Code:
Public Type ClassRank
Rank As Integer
ClassCount As Integer
End Type

I have a function with the following excerpt:

Code:
Function GetRank(strDOD) as ClassRank
...
GetRank.Rank = intRank
GetRank.ClassCount = intCount
...
End Function

In my query I expected to be able to put the following:

Code:
GetRank(strDOD).Rank & " " & GetRank(strDOD).ClassCount

However, Access didn't like the period in .Rank or .ClassCount.

Should I just write two different function to get 'rank' and 'classcount'?

View 2 Replies View Related

Modules & VBA :: Load User Defined Function At Startup?

Jul 15, 2013

I have quite a few user defined / custom functions which I would like to be available in any new database that I create without have to copy the VBA codes in a module each time. Basically, some sort of add-in that loads on MS Access startup may be (but I am not too sure - never created one). So something that will start with the MS Access Application and not just a particular database. I know excel addins can be copied to the XLStartup folder to achieve something like this in excel, but not sure about Access.

View 11 Replies View Related







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