Indexed Objects In Forms EG Label1(1).caption
Mar 22, 2006
Hi Guys (second post in 11 minutes!),
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?!?!
Cheers.
View Replies
ADVERTISEMENT
Nov 27, 2013
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.
View 9 Replies
View Related
May 30, 2013
I am building a form and part of the code is:
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.
View 6 Replies
View Related
Apr 15, 2014
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.
Call EmptyClipboard
Me.B7_DB_GCUH.Caption
DoCmd.RunCommand acCmdCopy
View 1 Replies
View Related
Jan 11, 2008
I have a database where my indexed field in my table is a number set up like this (ex, 1111-0108) where the first 4 numbers are the record # (so can't dupe) and the second 4 are the month and year. Of course the whole field is indexed with no dupes but changing the first 4 provides the change.
Right now we enter manually when starting a new record in a form. Is it possible to auto populate the new record with the next number in the sequence for the first 4 digits and the current month and year for the second 4? If not, is it possible to auto populate it with the next number in the sequence for the first 4 and leave the next 4 blank?
I'm a noob as far as programming goes, however I built the database so I have a "fair" understanding of access.
Thanks,
Dave
View 14 Replies
View Related
Mar 17, 2015
Is there a way to gain access to the Field Properties using VBA?
I'm trying to loop thru the Tables in a database and find out the Fields that are indexed in each table.
I can loop through the table Defs to get each table name and a list of Fields but I can't seems to get to the Field Properties, namely "INDEXED".
View 4 Replies
View Related
Mar 10, 2006
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.
Many thanks.
View 2 Replies
View Related
May 25, 2015
Customizing the form with the following code
Code:
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?
View 9 Replies
View Related
Jun 12, 2014
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.
View 3 Replies
View Related
Mar 12, 2015
Is there a way to get a string from a field and use it to set the caption value for a command button at run time?
View 2 Replies
View Related
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?
View 2 Replies
View Related
Apr 15, 2013
I have some code on a button that opens a form and changes the caption of a label:
Code:
DoCmd.OpenForm "frmRepair", , , , , , "CancelNo"
Forms![frmRepair].Form.[lblmain].Caption = "Missing Parts"
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.
View 13 Replies
View Related
Aug 14, 2015
I want to result as dlookup function in access 2007, when I use dlookup like this
=DLookUp("GPFDed","[SalaryAll]","[EMPID]='" & ![Cmb_EMPID] & "' And [SalMonth]='" & "Jan" & "' And [Salyear]='" & [me]![Label17].[Caption] & "'")
it gives #Name?
What is the problem and how can i change the label caption to Combo box column 2 value...
View 1 Replies
View Related
Oct 7, 2013
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.
View 2 Replies
View Related
Nov 13, 2006
I wish to in a subform where you can enter a image for a item.
How do you go about having a box you click, find on your HD the image and then have it display for that record you select?
View 4 Replies
View Related
Jun 11, 2013
I currently have a small database where users input information on return parts. I have added a section to add data from testing and have made it so it greys out certain boxes when the part type is selected using conditional formatting. However conditional formatting will only allow either a data box (Text box) or the label attached to it to be formatted. I am unsure of how to grey out perhaps a rectangle I created when the part type is selected. I assume its coding which I am not the best at.
View 1 Replies
View Related
Sep 16, 2013
I am building a form where I would like to group fields into 3 groups, A, B & C. I know I could put all groups on their own subforms but I'd like to see if there is a way to simplify it all on one form since there aren't much fields for each group.
I would also like to hide each group when the user clicks 'hide group A' and shift Group B & C up. Then move them back to their original position when 'Display Group A' is clicked.
Same for each group. If Group B - Hide is clicked, Group C is moved up.
I've got each group tagged appropriately and I can hide/display them all properly by a For Each Control loop. Now, how to I move them all up/down a specific amount in addition to that? I would think it would be just as easy but my objects are moving by using the Grid Y property
View 6 Replies
View Related
Sep 30, 2013
I have a simple date stamp that works great in a private sub within a form. (error handling removed for clarity)
Code:
Private Sub btnDateStamp_Click()
' UserInit is global variable
Me!Notes.SetFocus
Me!Notes = Chr$(13) & Date & " - " & Time() & " - " & UserInit & _
" -" & vbCrLf & Me!Notes
[code]...
I am rewriting it as Module function that is Called from various forms, to save space. The function receives the parameters varFormName and varControlName. I wish to write the results of the function back to a memo field on the form.I am stumped at the get go by the need to refer to the Forms controls with a full reference instead of the Me command.
Code:
Function DateStamp(varFormName As String, varMemoName As String)
'varInitials, varFormName, varMemoName are global variables
Forms!varFormName.Controls!varMemoName.SetFocus ' Error here
'Me!Notes = Chr$(13) & Date & " - " & Time() & " - " & varInitials & _
[code]...
how to refer to the forms control's with their full reference, from within the Module's function, the rest will fall into place.
View 3 Replies
View Related
Jul 16, 2015
I am currently working on a main form in Access 2010 which includes quiet a lot of fields, therefore i choose to create parts of it (which are as well optional, as they do not apply to all records) as different forms which i linked to the "mother" form afterwards through a checkbox by using the following code:
Private Sub chkMajor2_Click()
Dim strformname As String
If Me.chkMajor2 = True Then
strformname = "Major 2"
DoCmd.OpenForm strformname, acNormal
End If
[code]....
to make the next form visible for selection after filling in the current one...something like an "add more.." field actually, which i choose to represent as checkbox.The issue that i encounter is that when i click the "Add New" button in the main form, it doesn't clear also the fields in the linked forms. Is it possible to do that with a VBA code? Or how should i proceed?
The current code that i have for the button is:
Private Sub cmdNew_Click()
DoCmd.GoToRecord , , acNewRec
End Sub
View 9 Replies
View Related
Oct 17, 2013
I am building a simple form with a few Combo Boxes, text boxes and a picture. When two out of the three Combo boxes updates a few text boxes, labels but not all and the picture flikers/blink. I do have one other combo box that does not cause anything to flicker once it updates. This is getting annoying and it makes my form look unprofessional I do not have any vba or macros running yet on the form - I have tried different ways to creat the form IE. Form Wizard and Blank Design. I used the Look up wizard for creating the text boxes/ Combo boxes in the database.
The other thing I noticed is that when in design view the same objects blinks when I scroll up or down loger than the other objects.
I did search this site and the web but did not find anything that did not metion VBA code and the Echo on/off.
Access 2010
Windows 7
View 10 Replies
View Related
Jan 5, 2014
I have a database with a main menu which opens up on start-up it works fine and all but I want to go the extra step, I wish to disable / hide the ribbons (Top and Bottom) - Or Hide the whole Microsoft Access Window and display my form with the desktop behind it.
The next thing is once I click the X or the button to close the form I want Microsoft Access to appear again as in everything to show itself again.
View 1 Replies
View Related
Mar 29, 2015
From a info sheet on RTB Using the Add, Clear, and Remove methods, you can dynamically populate the control with embedded objects at run time. Can those 'embedded objects' be controls, e.g. list boxes, labels etc ?
View 3 Replies
View Related
Jul 28, 2005
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
View 3 Replies
View Related
Jul 10, 2005
Background:
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.
View 1 Replies
View Related
Apr 22, 2015
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!
View 5 Replies
View Related
Aug 21, 2006
All,
I am trying to get the caption text for a field instead of the raw database name. The raw database name can be extracted using the Fields Collection:
Fields.Item(w).Name
Is there a way to retrieve the caption, as this makes more sense to the user?
For example, instead of the field name "numEmp", I want to retrieve "Number of Employees".
I need this because I am creating a form at runtime (on the fly).
Thanks,
Sal
View 5 Replies
View Related