With this code, I can open Word and Excel files, but not PDF. Please let me know what I'm doing wrong. (I tried changing strProg = "C:Acrobat.lnk" including to a .exe file but nothing happens when I click the Open button)
I was wandering if it is possible to implicitly execute code upon the opening of a database? If so how do I do this? I have code to convert the page settings of a report from a command click but wanted this to be done automatically...
My database has two main tables: Table1 and History
Users can add data to this table and decide if store part of data into the History table using an append query behind a cmdbutton. I do this to create an Historical Log of my records.
I then have a main form (form1) with the following code on the OnCurrent event:
If Not IsNull(DLookup("[SSN]", "history", "[SSN] = '" & [SSN] & "'")) Then msgbox "Record present in the Historical Log!", vbOKOnly, "Warning" end if
I would now like to change this code so that users are prompt with a message that allows them to either open the form1 or the Historical log (frmHistory)
I would need something like this but cannot get it to work:
If Not IsNull(DLookup("[SSN]", "history", "[SSN] = '" & [SSN] & "'")) Then msgbox "Record present in the Historical Log!", vbYesNo, "Warning" If vbYes Then DoCmd.OpenForm "frmHistory", acNormal, "qryhistoryfrommsgbox", "", , acNormal
If vbNo Then ' 'open the regular form1.
Another thing I cannot figure is why this pop up msg comes up even if I close the form. Is there a way to revome it from the close form event?
There are 10 groups that may work on any given project.
Each group may perform any number of tasks.
I made 3 tables
1. Projects A. PROJECT_ID B. PROJECT_NAME C. GROUP_ID
2. Groups A. GROUP_ID B GROUP_NAME C. PROJECT_ID D. TASK_ID
3. Tasks A. TASK_ID B. TASK_NAME C. DESCRIPTION D. TIME_SPENT E. NOTES F. GROUP_ID
Projects to Groups is one to many Groups to Tasks is one to many. The problem I think I am running in to is how to show all of the groups in each Project even if a given group has not performed any tasks.
hi All, I've included an extremely cut down version of my database (33k zip file) with the example I'm trying to do.
There is a Combo Box (three options), I basically want this box to switch to the relevent record. (e.g. if you select Rural, it will switch to the next rural record) Rather, the combo box is changing the field of the current record to Rural which I don't want it do. I also want the ability to "Filter by Selection" too which it does but it just changes the current record :(
Any help would be GREATLY appreciated! It's been driving me crazy for days now.
If you click on "FOCUS OF SERVICE", the combo box in question is called "AREA" that is located up the top.
Does anyone know the code for opening a specific notepad file from a button? I know there's a default button but it only opens a blank notepad page. I need to open some written instructions from a button you see.
I have a database with lists clients across the UK. I have now been asked to provide options where users can select clients grouped by geopraphical area e.g say clients in Scotland.
I can of course do this but having numerous identical forms where the source queries have different parameters depending on the regions required.
The only problem with this is that I would need numerous forms and queries. Additionally, there are options on the form to navigate to linked forms which would all need to be unique.
What I would like to have options on my main (Switchboard Type) Introduction Form to select the region. The code on the relevent command button would include the parameter. I would therefore not require the additional forms.
The open form codes includes:
Dim stDocName As String Dim stLinkCriteria As String
I feel i need something after "frmClients" such as qryClients.ClientArea = "Not Scotland". Various attempts to incorporate something has created errors.
I have the following code that I have been trying to get to work:
Private Sub txtSocNumber_DblClick(Cancel As Integer) On Error GoTo Err_txtSocNumber_DblClick
Dim stDocName As String Dim stLinkCriteria As String
stDocName = "FrmApplicantFullDetails"
If IsNull(Me.txtSocNumber) Or Me.txtSocNumber = "" Then MsgBox "This record is empty", vbInformation, "No Data" Me.txtSocNumber.SetFocus Else stLinkCriteria = "[ApplicantID]=" & Me![InvestigatorID] DoCmd.OpenForm stDocName, , , stLinkCriteria End If
Exit_txtSocNumber_DblClick: Exit Sub
Err_txtSocNumber_DblClick: MsgBox Err.Description Resume Exit_txtSocNumber_DblClick End Sub
I have the following two tables:
Applicant and Investigator
Applicant: ApplicantID InvestigatorID etc
Investigator: InvestigatorID etc
The relationship is setup as 1 investigator to many applicants.
What I am trying do is this. I have form with a subform in it. In the subform there is applicant info IE SS# LName, FName and that is it. What I want to do is be able to double click on the SS# have the form "FrmApplicantFullDetails" open so you can view the work up on the applicant or edit info on the applicant.
Am I going about this the right way with the above code? Or is there something else I am missing in the code or is there code out that will do what I am looking for that is easier?
In the initial Form_Open code there is a string that fails before the form is open, preventing me from opening the form and accessing the VBA code to correct the problem.How can I access the VBA code to correct the problem if it otherwise prevents me from opening the form so I can access the VBA code?
I would like to have a button in a form that the end user clicks and they then enter the name of the tif file they are looking for and on pressing enter the file is searched for and if found it is automatically opened up for them to see, if it is not found then a message "File Not Found" is displayed.
I Believe that I will need something like this:
Code:
Dim FS As FileSystemObject Dim filenum As Integer Dim tmp As String Dim Folder As Folder Dim subFolder As Folder Dim File As File
[Code] .....
It's when I get to this point that I've got stuck, I don't know how to structure the code required to do the search and on finding the tif file open it.
An example tif file I might search for is: 0H214_2CJ0001905.tif.
I have an imported table that I created a form for (containing 400+ entries). I created a subform on it for a new table that I will be entering information to tie in with the imported form.
However, when I try to create a report, the report won't acknowledge any of the information. It's all outlined in the SQL, but nothing appears.
I did discover, though, that if I create a new entry on the imported table, that information appears on the report, but nothing for the existing data that was imported.
I am working with a normalized database that has MANY tables. Most of these consist of lists of options to select from for the primary table. The primary table is linked to the secondary tables (and those to tertiary tables) by Primary Key ID fields, and the other tables contain additional information.
For Example, the Name list table is related to the Actions table by the SSN field, and the Actions table is related to the PayStatus table by an ID number collected by a lookup field.
When I pull all three tables into a query to display all the information related to a particular individual an his action, there are more records if I remove the PayStatus table from the query. It seems to only pull reports for which a PayStatus has been selected.
How can I get the query to display ALL the records, whether or not the individual has a pay status? Whether or not the individual has one is irrelevant, but I want his name to be displayed, whether or not he has one.
well i tried asking for help on this earlier, but i wasn't able to find any help so here is my problem.http://img330.imageshack.us/img330/2850/pictureaccessro7.jpg (http://imageshack.us)the sales - net = profit is fine but what i want to do is have a totals at the very bottem. everytime i try to do this, i can only get the totals to show and each individual record dissapears, or nothing shows at all. i've tried using a report but i can't seem to pull it off either. if anyone knows what i'm talking about and knows what i have to do then please help me :)
I have a basic trouble ticket type database that I built. It records troubles and auto fills the date and time when a new records created. I want a simple query that will display the number of calls that each person has taken today.
The problem being that If I use >Date()-1 I will get calls from this time yesterday until now. Is there a way to round down the time to today only? I don't want to lose my time stamp.
I have a report that I would like to export to a folder, and I would like to include the FullName within the naming convention of the PDF. When I run the report it prompts for the Employee ID..Here is what I have so far, I'm getting an error of "Run Time Error 424 object required" on the String Report Name,
Private Sub Create_PDF_Click() Dim myPath As String Dim strReportName As String DoCmd.OpenReport "Report_Salary_Worksheet _Finalized_By_EmpID", acViewPreview myPath = "W:COMPENSPHYSICIANSComp Plans" strReportName = Report_Salary_Worksheet_Finalized_By_EmpID.[FullName] + ".pdf" DoCmd.OutputTo acOutputReport, "", acFormatPDF, myPath + strReportName, True DoCmd.Close acReport, " Report_Salary_Worksheet _Finalized_By_EmpID " End Sub
I am currently working on an instrument datebase, I have a mainquery that takes care of user inputs from a form. The main fields that have been queried on are Type, System, and Manufacturer and they are all look-up fields that contain some null values.
On the same criteria row for these fields, I have
Like IIf([forms]![User Interface].[qtype2]="","*",[forms]![User Interface].[qtype2]) Like IIf([forms]![User Interface].[qsys2]="","*",[forms]![User Interface].[qsys2]) Like IIf([forms]![User Interface].[qman1]="","*",[forms]![User Interface].[qman1])
qtype, qsys and qman are the user inputs from the user interface that returns look-up table values.
This works fine when all 3 of these fields are all filled out for a certain instrument. The problem arise when some fields of the instrument are left blank or is null. The instrument won't show up in a query at all. What I wanted it to do is to show everything including the ones with null fields when the user input are null or "". When the user specifies certain requirement I only want to show the ones that are not null. I understand that putting them on the same row means AND, I have tried to OR them and did not have the result i wanted.
I have a database with multiple forms and I would like to on close I would assume of the form, save a backup to a specific folder. This will all change once I move the database to the server but for now want a backup on my machine. Here is my code:
Code: Private Sub Form_Close() Call db_backup End Sub Below is in a module
[code]...
The problem is when I run this the program will give me an error saying: runtime error 438 object does not support this property or method
I am at my Login Screen, I want it to return to the Login Screen if you select "NO" and Close the DB if "YES"
Here is my current code:
Private Sub Form_Close() If MsgBox("Would you like to EXIT the Database?", vbYesNo, "Quiting Database") = vbYes Then Application.Quit Else ??? End If End Sub
I've created the following but it keeps coming up with the error message You tried to execute a query that does not include the specified expression 'ICE Team' as part of an aggregate function.
SELECT ztSub.[Master Sheet].[ICE Team], ztSub.[date], Count(ztSub.[Count]) FROM (SELECT [Master Sheet].[ICE Team],[Master Sheet].[Visit Date (planned for)] AS [date],Count([Master Sheet]![Visit Date (planned for)]) AS [Count] FROM [Master Sheet] UNION SELECT [Master Sheet].[ICE Team],[Master Sheet].[Date retasked to?] AS [date], Count ([Master Sheet]![Date retasked to?]) AS [Count] FROM [Master Sheet] ) AS ztSub GROUP BY ztSub.[Master Sheet].[ICE Team];
Access 2007-10 Listbox created: List62 (I know I need to rename it, but for now) Multi-select: Extended Row Source Type: Field List Row Source: qryFieldList Open Query: qrySelectedFields (I added primary key to first column, just to have at least one destination field).
Goal: to select multiple fields within listbox, click on command button to open query "qrySelectedFields" with selected fields from list box.This is the code I have on the command_click:
Dim varItem As Variant Dim strSQL As String If Me.List62.ItemsSelected.Count = 0 Then MsgBox "Please select one or more fields.", vbExclamation, "Healthcare REIT" Me.List62.SetFocus End If
[code]....
It does absolutely nothing - doesn't add the fields to "qrySelectedFields", doesn't open the query, notta.
In the menu in word there is some option to view the documents 1. Normal 2. Print Layout 3….
I open the word’s document from the access I insert value from the access into word.
I asked here some question in last week and I helped so much.
My question now is:
In the document in the word I put some bookmarks. One of the bookmarks is on the header (Title of the document)
And then when I open the document its open in a “Normal” view I want to open the document in “Print Layout”
Can I open a document in “Print Layout” by code?
The problem code is: objWord.ActiveDocument.Bookmarks("nivchan").Select objWord.Selection.Text = Me.M_NIVHAN Because the Bookmark: “nivchan” is on the header.