how to change a form icon and make that icon embed to my database, I have tried the Application Icon property in Access Options but when I copy the database to other computer then the icon disappeared.
Public Declare Function LoadImage Lib "user32" _ Alias "LoadImageA" _ (ByVal hInst As Long, _ ByVal lpsz As String, _ ByVal un1 As Long, _ ByVal n1 As Long, _ ByVal n2 As Long, _ ByVal un2 As Long) _ As Long
[code]...
I can load the little icon on the left on CaptionBar.It works very well on overlapping mode but no on Tabbed documents. How to works with tabbed documents mode?
I have a form, the view of which is continuous forms. It has information on the left of the screen which the user is expected to manually match to information on the right, based on the suggestion of the underlying query (based on table a and table b)
E.g.
Client A $200 <button> Mr Smith $200.00 Client B $100 <button> Mr Smith $100.01
There is a button "match me" which when clicked runs an update query.
My query is how do I change the caption on the "match me" button to say "matched" just for the one that is clicked? Because it is a continuous form, if I use Command1.Caption = "Matched" or Me!Command1.Caption = "Matched" it changes it for all the buttons on the form.
I currently use code in a module and code on each form in the on_load event to change the icon of the form.. the code i use is as follows..
in a module:
Code: Private Declare PtrSafe Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long Private Const WM_SETICON = &H80 Private Const IMAGE_ICON = 1 Private Const LR_LOADFROMFILE = &H10 Private Const SM_CXSMICON As Long = 49 Private Const SM_CYSMICON As Long = 50
[Code] ....
And on each form on load:
Code: SetFormIcon Me.hWnd, "k: est directoryhsicon.ico"
What I am wondering is would it be possible to store the .ico file within the DB file itself (i know access can store bitmaps) and reference the .ico in the form load event code?
Overtime the db file will probably move to its own dedicated storage so using a direct reference to the file wont work..
I have tried the following but get an error (it tries to reference the .ico file as to being in the root directory of the db file)
I have a Form in which there is a textbox. I would like the name (caption) of the Form (that shows in the tab at the top of the form) to be named/updated to whatever is entered into the textbox.
I'd like to have a custom icon for the accdb file for the users. I recall doing it for pre-2007 databases, but I can't figure out how to change the 2007 db. Is it possible with 2007?
I have a text box in a form, in which users enter updates. I would like that text to become the caption on a label in a printable report. How would I write the VBA to do this?
This code works well and frmRepair opens with the updated label caption. The original value was "Return/repair Information"
A few other things need to change on frmRepair depending on this caption as well as the values of some other fields, so I use the following code in the onload event (although I later tried the onopen even)
Code: 'Disable labels button if there is no RMA and the item is a repair MsgBox Me.lblmain.Caption If Me.lblmain.Caption = "Return/Repair Information" Then Me.txtRMA.SetFocus MsgBox Me.txtRMA.Text
[Code] ....
However, I cannot get this to work as the "if" statement always returns "Return/Repair information" and not the modified caption. The message box confirms that this is the case.
I suspect that this has to do with the point in time that the frmRepair loads or opens and when my code enters the modified values.
Code: Private Sub Form_Load() lblSalary.Caption = "Enter Salary" txtSalary.Value = "5000.00" cmdIncrease.Caption = "Increase Salary" End Sub
The problem I am having is that I dont understand why the cmdIncrease button does not display "Increase Salary" when the form loads. The button is there but it is blank. The lblSalary button displays "Enter Salary" with no issues.... and I do not have "Enter Salary" in the caption property window... only in the coding window but it still works.
I am trying to copy a caption from a form to the clipboard so that I can later paste it into another application.
The code I have found via a search on this website 1) Clears the clipboard and then 2) copies the caption from a nominated field. 2) doesn't work as I sure I have the statements wrong.
I have a form with a subform. The subform displays records in datasheet format but is not linked to the main form.
I am attempting to get the hightlighted record on the subform to appear in the main form's caption bar. If I isolate the subform then that subform caption shows the current record on the datasheet. I can't get it to work on the main form however.
On the main form's current event I have Me.Caption = Me.Subform.Form.EmployeeID The main form caption only shows the first record on the subform.
Can anyone help me on this. I have searched everywhere Regards
In VB you can index objects, and create duplicates of them, like this... Code:Load label1(1)label1(1).Caption = "This is a label" But to do it, you must first create the original object in Design view, and set it's Index property to a number (there is an Index field in the Properties window in VB). For examle, to do the above I would create a label called Label1(0) in design view.
However, I cannot find this Index Field in the Properties window in Access - can you even create arrays of objects?!?!
I created an icon for my database application and I would like to display it in each form's title bar. Is this possible? And if it is, how? A few years ago I learned a little Delphi programming, and there this is possible to do. Thanx!
how I can replace the MS Access icon in the windows 7 taskbar at the bottom of my screen with my customized one. I already added under the access options the form and report icon and was hoping that this may solve the issue. But my own icon just pops up on the title bar of the main access screen, forms and the reports.
I got an image bitmap that I want to use to customize my button. I got following error pop up."Image Generator" - "search key not found in any record".I'm using access 2013
I read some solutions to replacing a default Access icon for forms. However, I was wondering if there is a simple solutioin to removing them all together without causing an error?
Is it possible to use a formula in the Caption property of a page in a tab control (i.e. to make it dynamic)
I have a number of tabs each with their own subform (with each subform driven by its own unique query)
I'd like the tab name to include the number of records returned by that query (so as records are added, the tab name is automatically updated with the new number)
So something along the lines of :
Page 1 (" & DCount("[ID]","[qryQuery1]") & ")"
Such that the page name appears as :
Page 1 (7)
I know I can code this programmatically but then that code has to be triggered by some event and I need the counts to be as real-time as feasibly possible rather than requiring the user to click on a control to trigger it. I was hoping by using a formula directly in the Caption property of the page, it would be dynamically updated every time a new record was added without the need to trigger an event first.
I would like to create a series of help fields for various text boxes on a form to free up space that is currently displayed in several labels.
Does anyone have an example that will allow me to create several help field icons on a form. Clicking on each individual icon will display a help message for that particular icon? I would prefer to store the data on a table. If I write this, I will probably use a recordset and display the data in a label.
I just wondered if anyone else has any other ideas.
When I access the form the column caption is "txtHours" !
As you can expect it looks ugly.
So to get a decent caption like "Hours" I am forced to set my textbox name to "Hours" !
As you can expect it goes against my coding standard to do that.
Beside I want the caption of some textboxes to include some non-standard letters such as `é' è' '!' ' ' etc. and if I put those in the textbox name it ruins the visual basic code !
I have a continuous subform which queries a table of attachments. I'm using Access 2007 but not using the Attachment datatype; this DB will grow considerably and I don't want to waste precious space by filling it with bulky files. So instead, I have code which makes a copy of the attachment and adds the hyperlink (to the copy) to the table instead.
Now - I want to add a control to the subform to display an icon / image reflecting the file type of the attachment (Word doc, Excel s/s, PDF etc.)
But not sure how to go about it.
I was thinking I could use FileSystemObject.GetFileExtension at the point in the code where the attachment is added, and add a new field to my attachments table (i.e. translate "*.xls*" to "Excel", etc.) Then store / embed a handful of images for the core types I would expect and use an image control on the subform to display the image based on the value of that field.
But is that even possible / feasible?
Or, is there a handy API which can retrieve the icon associated with a file type based on what has been installed on the local machine (even if there is, there's still the problem of setting up the image control to display the appropriate icon specific to each record...)
Or, is there another control available which would be better suited to something like this than an Image control?
I want to use buttons on a form to change the sort order on a continuous form. In the buttons click event I am using a public function (named Sort_1) to change the sort order. The first element of the event call is the name of a generic query (named Sort_1_Query1) and the query field to sort (LAST_NAME OR FRIST_NAME, depending on the button.)This is the Click Statement.
=Sort_1("Sort_1_Query1","LAST_NAME")
This is the Public Function Public Function Sort_1(SortName As String, FieldName1 As String) DoCmd.ApplyFilter SortName, FieldName1 & "between 'A' and 'Z'" End Function
I think the problem is in the use of quotation marks or trying to pass the query field name to the Do Command or the use of an ampersand.