Using Access 2010 on Windows 8.1. I have a subform that has 18 small MSGraph objects on it. I am requerying each chart when the user selects different filter options. The charts are very simple (no legends, no titles, 3 columns on each, number format in %) the MSGraph controls are all the same height and width. I have am using a public sub to try to control some of the formatting eg font size and style for ticklabels and colour of the columns (which all seems to be working) but despite this consistency, the graphs all render different sizes failing to "Stretch" to fill the MSGraph control. The tickLabels are also different sizes despite turning Autoscaling off and setting a font size. I can't set the chartArea.Height or width. At this stage I would settle for them all to be the same size -
Code:
Public Sub GreatFormats(EBSArea As String, GrNumber As Integer, SFrmName As String, FrmName As String)
Dim GrphName As String
Dim GrpType As String 'Status or Priority Graph
Const twips As Long = 1440
Dim MySForm As Form
Set MySForm = Forms(FrmName).Controls(SFrmName).Form
For I = 1 To GrNumber
I can find plent of references to using the Microsoft Chart Active-X on the internet.
I can find very little information on MsGraph objects. I actually control them rather well through VBA (i.e., Graph_Data.axes(2).minimumscale = MinScale(((Val(Me.ProbeLowestRespoce)) - 5) - ((Val(Me.ProbeAverageResponce)))) )
It's funny that the example statment only works with axes spelled incorrectly!
What I would like to do, if I load larger amounts of data is change the tick marker to the equivelent to "divisionspertick=2". That is a MSChart control, which I think is different from MSGraph.
In Chart, the following statement is, apparently, correct: .Plot.Axis(1).CategoryScale.DivisionsPerTick = 2, but doesn't work with MSGraph.
Does anyone here know the correct VBA commands for an MSGraph object? Is there a list, somewhere, of all available parameters that can be modified programmically?
I set my form to come up on startup as the default sortof page...
When it came up however it only opened up in a small window, and I wish that I could get it to come up as a fullsize "Maximized" window. What do i do to get this to happen? Also, i cant re-size the form when its in form view. All i can do is click the X.
I have a Form with a Command button that will cause a Report to run in Preview mode. My code is: DoCmd.OpenReport "reportname", acPreview DoCmd.RunCommand acCmdZoom100 The zoom allows the report to be readable but I am unable to change the width of the preview window so the entire report is visible. Any ideas? thanks in advance for any help...
When a control like a check box or radio button is on a form, how can you make the size of the actual control bigger? When changing the size in Properties, it only increases the size of the black border.
Access 2007 is behaving very peculiar concerning sizing of forms. For example, some open at an enormous size (25 plus inches) when the width size in the property box is 8 inches. I've tried various combinations of Auto Center, Auto Resize and Fit To Screen -- all with bazarre, unpredictable results. Does anyone know if there is an "issue" (bug) in Access 2007 Trial concerning form sizing? Thanks.
My end goal is to populate a pre-existing table in an MS Word document with records from a query. The easiest way I've found (through scouring the internet) is to start with the code below (ran during OnClick() even in Access) to get the table the same size as the recordset:
Code: Dim wDoc As Word.Document Dim wTable As Word.Table Dim wCell As Word.Cell Set wDoc = appWord.Documents.Add(strDocLoc) wDoc.Visible = True
[Code] ....
The code will shrink the table down just fine if the table has more rows than the recordset +1 (for header column). My hangup with this is the last line ("Selection.InsertRowsBelow 5") isn't executing; rows are not being added to the table. I get no errors -- it just does nothing. I set it as "Selection.InsertRowsBelow 5" arbitrarily just to see if it would even add rows, and sure enough it's not.
I have main form (frmProcedures) that has a tab control with 2 pages. One of the pages I have a subform that contains a listbox control controlled by a query.The subform is a search and display form. When I open the subform on it own, it opens up fine. However when I try to open up the mainform, it always prompts me to enter the parameter value. I have to atleast hit "Enter" for the form to open up.Even after hitting the enter key, when I try to navigate to that page, I keep getting the parameter prompt.
Here is the query that populates the listbox control. And the parameter that is prompted is Forms!frmSearchMulti!SrchText that you see in the query below
SELECT Procedures.ProcedureName, Procedures.BusinessLine, Procedures.Manager, Procedures.ApprovalDate, Procedures.NextApprovalDateFROM ProceduresWHERE (((Procedures.ProcedureName) Like "*" & forms!frmSearchMulti! SrchText & "*")) Or (((Procedures.BusinessLine) Like "*" & forms!frmSearchMulti!SrchText & "*")) Or (((Procedures.Manager) Like "*" & forms!frmSearchMulti!SrchText & "*"));
I do have a searchbox that when updated with search string issues the requery to update the values in the listbox.
I have a global function which I have hooked onto the onClick event of controls. Currently I am using commandButtons as my control of choice. In my function I can then reference Forms.ActiveControl which is no problem.
However, for lots of reasons I really need to use Image controls. Now, my problem. Image Controls have an Onclick Event, but they do not get focus so the Forms.ActiveControl will not work.
How can I identify the image control that has generated the click event if the control itself does not get focus and so cannot be referenced by ActiveControl? Working on a possibly work around, but could do with the best brains in Access on the case!
A main form - named [formMain] On [formMain] I have a tab control - named [tabMain] [tabMain] has 3 pages named [pageOne], [pageTwo] and [pageThree]. On [pageThree] I have created a subform named [formSub]. On [formSub] there is a tab control named [tabSub].
Now what I would like is to make [tabSub] (in)visible if the user switches from [pageOne] or [pageTwo] to [pageThree].
Code: Sub tabMain_Change()
How do I refer to [tabSub] from within this subroutine? I am trying something like:
I have a continuous form populated with a pivot view from SQL. When I enter data in the form I send the data to SQL (ctrl after_update) and then re-populate the form. It works.
When I have entered data in a ctrl - then I have to bookmark the record so I can select it again (find_first). I can "save" the location of the control where I have entered data, but I want to select the location where the user has set focus - which triggered the ctrl after_update..My ctrl after_update looks like this:
I have a main form that has a Tab Control. The tab control could have 5 to 10 tabs. Each tab has a subform and in some instances a tab could have a tab inside that tab with subforms as well. I want to be able to get the subform names in each tab.
I am able to get the main form name by using me.form.name
How can i get the names of each subform in each tab?
I am creating a dynamic form and need to get the names into variables for later use...
I have some graphs on a report that I need to dynamically position. The user selects which graphs he wants to put in and then the reports repositions the graphs based on input.
I've been using the following code to move the graph:
reports!rpoly.gGPCMWbyDRI.top = 3.625
which compiles, but moves the chart to the "0" position. I tried using a string ("3.625"""), or a stint ("3.625") but neither worked.
How do I get VBA to say: Go to the first control in the tab index after the current active control (that is visible atm), except such and such controls (because they will lose visibility in a moment).
I have two command buttons having two textboxes to populate. The way I am going to populate the text for both the textboxes is same but on separate clicks. Is there way to find which button (or control) is being clicked in runtime. I think I have done it a long back but not getting right now (I had a gap in my career). The keyword sounds like some 'Defaultcodecontrol' or something like that only.
I want to have a Combo Box on a form, that derives its values from a Table, but does not send selected values to another table. I want to use the value selected in the combo box in VBA code.I have set up a combo box, without a control source, and it shows the values in the drop down list but after I select one the box just goes empty. I expected that after selecting a value that value would be displayed in the combo box (and that would then become the value of the combo box that I could then use in code. I.e, CmdBox1.Value). If so, what do I need to do so that the value selected is displayed (and becomes the value of the combo box?).
I have a POS system, packaged with Access Runtime, running on a PC and have developed a database system to provide additional function. I have no documentation to the names of the Forms or Controls in POS. My ADDON system does link to the POS Tables and has some Tables of its own.
At the time in the POS system where the cashier checks out the customer, they need to AltTab to my ADDON system to enter some information for the customer. They remember to CustomerKey from the screen on the POS system and key it into a Form Control in my ADDON system.I want to, from my ADDON system, read the value of the CustomerKey in POS and fill it in so the cashier does not need to remember/type it.
Is it possible to get the data from another already running Access database?I don't know the name of the control. Is it possible to run through a list of Forms and Controls in the POS system from my ADDON system?
I do know the name of the field in the Table and expect it to be current and might have to get that?Failing all that, is there a Collection of running Access databases? I could go through its Forms and Controls one time looking for what i want.
On my form I have a combo box where the user can select the sex of a person. I had set the row source of the combo to a table, tblSex and this works fine. Now I want to programatically add the table entries ( simply male or female) to the row source, having set the combobox to value list. I cant see how to pass the combobox and tablename parameters and I am getting an error on form load "The expression you entered as the event property setting produced the following error: UserDefined type not defined" The calling procedure from frmPeople is
I think the way the parameters combobox and tablename are passed is incorrect. I want to write a robust procedure which I can use for each of the comboboxes on my form.
I need to duplicate a number of controls on a form. They are all acCommandButton types, but they have different images, sizes etc.
Anyway, my thought process was if I have a "template" acCommandButton then when I create my new controls if I could use this template then the code I have hanging off them (I have a function being called on the onClick event, borders are set to hairline, themes turned off and various other settings) would be copied. Save me trying to set them all individually.
So, my question is, can I "copy" a control in form design through VBA. Once I create the copy of the control I can then change the couple of properties I need to and "hey presto" I have skipped a load of settings that I don't need to set.
At the end of the process when I rename my form I can delete my template control and I have a working form.
I have a form titled 'New/Edit/Search Contractor Employee" that provides controls to fields within a table titled "Contractors". In this table, I have a Hyperlink field that will store the location of the files related to individual employees. On this form, I have a Control that (at the moment) the user can copy a Hyperlink and enter into this, to populate the field. This will then allow the user to click on this Hyperlink to open up the individual folder location to drag and drop whatever files they want associated to this individual record.
I have created a Command Button to automatically create a unique folder for this record, VBA below:
Private Sub Command168_Click() strPath = "V:IntProdTrans&OpsTERMINALSDriver and Contractor Database 2014ContIndPW" & "" & txtCompanyID If Len(Dir(strPath, vbDirectory)) = 0 Then MkDir strPath End If strPath = "V:IntProdTrans&OpsTERMINALSDriver and Contractor Database 2014ContIndPW" & "" & txtCompanyID & "" & txtFirstName & " " & txtLastName If Len(Dir(strPath, vbDirectory)) = 0 Then MkDir strPath End If End Sub
What I'm trying to work out now is how to automatically enter this new folder location into the Control, which is then viewable and can be clicked on. I managed to do this (can't for the life of me remember how) but it entered the location as text and I wasn't able to click.
The Hyperlink control is titled 'Induction Paperwork' relates to a Hyperlink field.