Forms :: Text Box In Form To Update Report Label Caption?
Oct 2, 2013
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 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
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 a userform that pops up when I am implementing a VBA subroutine. The nature of the form is simply to update the user what progress through the operation the code is using a label called lblProgressText.
So, I have a form called frmProgress and in my loop I use:
The lblProgressText control just wont update (but earlier today it was so maybe I have broken something).Btw, all this code is run from a Module, not in the form object.
I'm running Access 2003 and my question relates to delivery notes that are produced for drivers as reports. These delivery notes have a blank payment box for the driver to complete if the customer pays upon delivery.
As more and more customers are prepaying by credit cards, I'd like this payment box to be automatically filled with a "PAID" text which will let the driver know the order has already been paid for.
The delivery note is produced from an "Orders" table which has a "Paid" field whose value is automatically set to "Yes" when the order has been paid for.
I was hoping to be able to place a "PAID" label on the report which is only visible when the Paid field of the underlying query is Yes.
As things are at the moment I cannot see any way to put any conditional statement onto this Text/Label. The only options for the "Is Visible" property of the text are Yes or No.
I am attempting to use VBA code to make the label in my report hidden if the text box is blank. I am very new to coding, and am not sure how I would express this in code. I have been looking at a few examples of how to get this done, but it doesn't seem to work. Where to insert the code. Attached is the image of the properties for my label and text box that I want hidden if text field is blank. I al just lost trying to figure this out.
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.
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.
I have a Menu form that has 5 cmdbuttons that opens the same main forms but with 5 different filters. I want a label or text box to change to the name of the filter. I am using VBA to open the form. I can't code a form that's not open yet. Is there any way to accomplished the above?
I have a report base on my table. Here a check box. I wanna show two label text hide/show base on when check is true or false. It will be when report will be open. I have try this but nothing is happened.
Code: If AffecteAc= True Then affected.Visible = True general.Visible = False End If
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
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.
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?