On a form I have multiple labels. In the Click event of all these labels I would like to call a generic function for futher processing. For this processing however, I need the caption of the label the user clicked on. How do I determine this caption?
I have globally defined 'Progress' as integerer and using the following code on my splash screen - i want to add a "." to the end of the label caption until progress = 10 (10 timer events)
Private Sub Form_Load() Progress = 0 End Sub
Code: Private Sub Form_Timer() Dim Dot As String Dot = "." Progress = Progress + 1 Me.lblProgress.Caption If Progress = 10 Then DoCmd.OpenForm "frmLogin" DoCmd.Close acForm, "frmSplash" End If End Sub
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.
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
I am trying to write a Macro which will change the Caption of Several Tab Control Pages, based on entries in a Table.
Here is the entire three step macro:
Open Form Form Name: Draft View: Design Filter Name: <none> Where Condition: <none> Data Mode: Edit Window Mode: Normal SetValue Item: [Forms]![Draft]![TabCtl32].[Pages](1).[Caption] Expression: =DLookUp("[BFL Team]","BFL Teams","[ID] = 8") Close Object Type: Form Object Name: Draft Save: Yes
All Appears OK, except I get two different results, depending on what I try to name the Tab Caption.
If the Value in the "BFL Teams" Table pointed to by the DLookUp Statement is a number (Like 1234), all is well, the Macro Executes as expected, and the Tab Caption is updated to 1234.
What is madening is that I want to use an alphanumeric name. When I try to use anything other than Numbers, (Lets use 'Text' as an example) the Macro Barfs on the second statement with the message:
"Microsoft Access can't find the name "Text" you entered in the expression"
I am using Access 97, if that helps. The entire Database is automated using only Macros (No Modules).
This is my Fantasy Football League Draft Software that I have developed over the past several years. I am by no means an Access Ace, I just got this thing to work through trial and (lots of) error, for the most part.
What I am trying to do is to automate the changes I have to make every year, and one of them is to handle changes of Team Names, and I have a Tab Control for each Team with the Team Name as the Caption.
I would just like to have the Captions on each Team Page to be updated from entries in the "BFL Teams" Table, as part of a Macro I would run to automatically set up the Tables, Forms and Reports each year, rather than make the Brute Force Changes on an anual basis.
I am sure that I am just doing something bone headed, but for the life of me, I am at a loss on how to proceed.
Thank you to anyone who takes the time to look into this.
I'm trying to customise the error message for Input Mask Violations, so that it references the control where the error has occured, rather than just being a generic error message.
I can make this work using the code below:
Private Sub Form_Error(DataErr As Integer, Response As Integer) Const INPUTMASK_VIOLATION = 2279 If DataErr = INPUTMASK_VIOLATION Then MsgBox "Please check that the information you have added in the " + Screen.ActiveControl.Name + " field is in the appropriate format." Response = acDataErrContinue End If End Sub
BUT, all my field names are shortened e.g. Mobile Number = MobileNo, so I want to use the caption property instead. I assumed I could just change it to "Screen.ActiveControl.Caption". But this doesn't work at all!
I want to create a form that will be the layout of my storage warehouse. I actualy have a layout on paper but was thinking of doing it on a form for the users to have a better view. The location of the inside warehouse have 60 location or Bin. The outside one has 80 Bins. This will need 2 query. 1 for the inside Bins and 1 for the outside Bins. They are both the same query except for the caption of each command button.
What will be the beast way to create the query as to the criteria is to read from thee caption of the command button. If the caption is 50 then give me everything in 50.
Hi All. I created form with unbound listboxs based on query which included Credit field that I want to calculate total and show result in caption of window. If is it possible how to do it? Thanks.
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.
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, 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'm trying to show a count of filtered records on a form. The Filter is number of days from the system date which I've already built into a query. I'm trying to get the record count for each day out up to the tenth day and show the counts on a form. Is this prossible? and how is it done?
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?!?!
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?