I want to run a function when my application closes. But it must run in all cases, so running it on the last form, or in a hidden form, is not good enough. Even if I'm in design mode with no forms loaded, I want it to run.
For background info - my app is locked down tight against clients poking around. I have got a way for me as developer to get into the "back door", and what I'm trying to do is make sure when I'm finished doing my stuff that the app is locked again without me having to remember to do it.
Access 2010. I've created a database on my thumbdrive and I'm now wishing to place it on our network for multi-users. In copying/pasting the database the the network drive I'm getting the following error message when either trying to Compact and Repair and/or just simply close the darn thing.
Error message:You can't exit the Microsoft Access now.If you're running a Visual Basic module that is using OLE or DDE, you may need to interrupt the moduel.
I want to make my Courseid field visible in my form based on whats entered in my StudentID Field.I've used the following code but i'm getting an "Else Without If" error:
Code:
Private Sub Form_AfterUpdate() If Me.studentID = "Pending" Or "Rejected" Or "pending" Or "rejected" Then Me.Courseid.Visible = False Else: Me.Courseid.Visible = True End If End Sub
If the studentID is a number then i want the course to become visible but i don't know how to use the isNumeric function this way.
I'm trying to add a couple of buttons to the QAT to run public sub's saved in modules within the DB but for some reason they are not showing when I try to customise the toolbar?The sub's are fairly straightforward (they just open forms) and are saved in a module within the project :
Code:
Option Compare Database Option Explicit Public Sub NewEntry() DoCmd.OpenForm "DataEntry" End Sub
[code]....
But when i try to add them to the QAT, they are not visible?
If my user uses the MS Access 'X' button (upper right hand of screen) to Exit the application does anyone know what methods are triggered that may let me perform some task before the application actually ends? Thanks
Dim var1 As Variant, var2 As Variant, var3 As Variant, var4 As Variant DIm var5 As Variant, var6 As Variant, var7 As Variant, var8 As Variant Dim var9 As Variant, var10 As Variant Dim i1 As Long i1 = 1 Do Until i1 > 10 var & i1 ??? = "0" & i1 & "." & txt1 & "." & txt2 i1 = i1 + 1 Loop
How to make concatenate var + i1 to make loop function?
Is it possible to compare rows, ie in excel I could do =A1=A2 to compare certain fields then if they are different/the same highlight.Is there a way of doing this in access?
I now try to rework on an old project but when I try to run some queries I get an error message: Undefined function 'Date' in expression . The same happen for the Format function.Both are built in Access functions
I have a ICT exam on databases in January for A2 ICT. It is based on a sixth form college. I need to add new units for the courses via a form, with the unit being uniquely identified using a Unit Code
The Unit Code consists of the first 3 letters of the Subject Code, the first 2 letters of the Description of the unit and a number.
Eg Subject ID : ARA001 and Description: Culture will have a Unit code of ARACU1
I'm trying to find a way to automatically create the unit code on the form. The first two bits have been solved fine,however, i have had difficulty of putting the number of the end. It seems easy in practice as i need to find a Unit Code like the one i have on the form but find the maximum number of a identical code and add one to it. I thought if i did
Like "[Forms]![frmaddnewunit]![txtUnitCode]*" as the criteria on a query with the field being Unit Code from the Unit table it would find data like the one on the form but it doensn't.
I thought i would use the data from the query and use Max(Right([UnitCode],1))+1 to get the number and add this to the code in the unit
This formula on the unit code text box on the form solves the first two bits of the problem
but i need to find a way to find unit codes thsat exist similar to the ones that are created and then find the maximum number and add one to it so i have a valid unit code
e.g
if on the form i select Subject ID ARA001 and Description Culture
The unit code will display ARACU.
I then need to find unit codes similar to this (There is one that already exists ARACU1) and find the max number on the end and add one to it
So ideally the code that will be automatically generated in this case would be ARACU2
I have a function which I want to return the value of a field.
Public Function fieldValue(tblName As String, fldName As String) Dim drs As Recordset Set db = CurrentDb Set drs = db.OpenRecordset(tblName) fieldValue = drs.Fields(fldName).Value drs.Close Set drs = Nothing End Function
I need to return the value obtained, for a specified User identified with a numeric variable.What is the best way forward? - Some sort of filter or DLookup and how to code this?
I am working on recreating an excel file in access. My excel files uses the Vlook up function to get data from a table for calculations.I am calculating Fruit Solids.
(BRIX VALUE references a cell, and quantity references a cell just used the names instead of cell references).The Brix table has 751 entries. The headers for the following tables are "Brix, Gravity, Weight, GFL, LBS, FS/Gal".So the look up table takes the BRIX value, finds it in the first column then takes the value in the 6th column(FS/Gal) then multiples that by the Quantity inserted in the other table. I didnt create the Vlook up access form so I am trying to get an understanding and recreate it in access.
In access i made a table called BRIX to store the Brix table information like the one in excel.Then i have fields in a different table where you enter the quantity, and brix value of the product. I now need to make the Vlook Up function in excel work for my access data.
I have created inventory databases for both my job and personal use. I do not understand coding. I either need a good hand-holding with simple, detailed instructions or I need to hire a code person.
A button in my form that can be coded to ... When clicked ...
___ open a browse window of hard drives, ___ allow user to choose any single image for selection, ___ copy & paste selected image's location to a table field.
NOTE: Table field will be used to connect to image place holder on form with control source to make the image seen.
I want an example of choose function to write in expression builder in access 2007 ..
I have a size as 1/4,2/3,4/9 etc to be converted to ABC,DEF,GHI etc . i have nearly 40 entries so i think choose statement would do it .. moreover i cant find switch statement in expression builder .......
For example one could be to replace the text ..... or any other method to change the size to alphabetical grade.
I have loads of projects in a table, they all have a status (eg Red, Green, Amber).
I have a query for each so if you run qry_RagRed, it will show in a sheet all Red projects and obviously have a total in there.
So I have a form which has buttons on it for navigation, what I want is to display various things on there so for example, a field that simply has the number of red projects, or green etc.
All I want it to do is tell me a number based upon number of items in a query.
I'm relavtively new to databases but after a steep learning curve (being left with many databases created by my old manager with no instructions on use) I'm getting there.What I am trying to do is pull out the date from records in a field called "Model_ID". The Model_ID field contains this kind of information:
Endscopy20120726JSmith GISurgery20120521JDoe
I want to bring back "20120726" or "20120521". In excel I can do this with the mid and find functions but find doesn't work in access. I've tried combining the mid function with instr function but it comes back as too complex!
I've created a new database using the standard Switchboard function. However, when I use the Exit Application command the database closes but MS Access stays open. It's a minor problem but infuriating, especially as I've never encountered this problem before and everything I try won't fix it. Any ideas?
I'm having an application which is developed in access. It's running quite well, some times when I made changes to forms or reports it hangs for a while and exits without saving, it happens sometimes not always... what could be the problem? how can I rectify this..