Access Form Text Box Name Property With A Bracket
Oct 3, 2014
Is there any way to name the text box like "Contract (1)" I can write it this way but it is recognized as Me.Contract_1_.
I need to name it Contract(1) as I have to run some iteration in VBA.
View Replies
ADVERTISEMENT
Sep 23, 2004
On my switchboard form, I have a check box which the user can check to make a text box (which appears in several different reports) visible and uncheck to make it invisible. The text box in the reports has the same name on all of them.
I am having trouble making this work.
I can think of two solutions, but haven't had success with either yet.
1. I could simply change the visible property of the report(s) control from the form. This works if the report is open, but throws an error if the report is not open.
Code:Public Sub showNumOrgsInReportCB_AfterUpdate()If Me!showNumOrgsInReportCB.Value = 0 ThenReports![publishZipR]![numOrgsF].Visible = FalseElseReports![publishZipR]![numOrgsF].Visible = TrueEnd IfEnd Sub
Is there a property or function I can use to test whether the report is open before I set the text box visibility?
2. Alternatively, a less elegant solution would be to run an event procedure to close all open reports. This would eliminate that issue, but I haven't gotten the code to work yet:
Code:Public Sub showNumOrgsInReportCB_AfterUpdate() Dim rpt As Report ' Enumerate Reports collection.For Each rpt In ReportsDoCmd.Close rpt.nameNext rptEnd Sub
This line:
DoCmd.Close rpt.name
throws a Run-time Error '13', Type mismatch.
How do I fix that?
I'm open to better ideas!
Thanks
View 2 Replies
View Related
Jun 9, 2005
I have a form that is to be used to browse through parts using various filters (like category, snippets of part number or description) to find particular components, and then draw information from those components onto the form to be used for other things.
Queries I seem to understand - I've made a query which I've embedded on the form which happily filters the parts using the combo-boxes and text boxes on the form.
What I can't figure out is how to access the information IN the query! There doesn't seem to be a "double-click" event, or a "highlighted row" property, that I can use to tell the query WHICH of the parts returned after filtering is the particular one Im interested in, to draw information from the row.
What I want is a command button that, once the desired part is selected, "sucks" the data out of the query into text boxes on the form.
I've tried something like -
Private Sub cmdSelect_Click()
Me.txtSelectedPartID = Me.qryPartFinder.PartID
End Sub
...but it tells me that the method or data member is not found. When I'm typing the code the auto-complete thingy happily finds "qryPartFinder" when I type "me", but none of the available properties in the list for qryPartFinder seem to be what I need.
How DO you access the data in a highlighted (and/or somehow selected) row?
TIA.
Col.
View 2 Replies
View Related
Apr 10, 2014
I am studying a book trying to learn vba and in the book it says, "To clear the text box of all contents, simply assign an empty string, also known as empty quotes, to the text box's Value property.
Example:
Code:
me.text1.value = ""
where would I actually put this line of code since I cant seem to find the value property in the property sheet of the text box?
View 3 Replies
View Related
Mar 9, 2013
I have set the decimal place property of a text box to 2. Then when i run a query that puts data in that box, the deci places are still well over 2..It lokks to be over riding it, how do I stop this?
View 4 Replies
View Related
May 14, 2015
I am having a little problem with making an audit trail for a form with some unbound text controls on it.
Since .OldValue won't work on unbound text boxes, google suggested that I put the old value in the control's tag property. This is what I came up with:
Code:
Dim ctl, tbox As Control
Dim strName, strOLD, StrNew, NewTag As String
Dim NextOne As Label
For Each tbox In Me.Controls
If TypeName(tbox) = "TextBox" Then
Select Case tbox.Value
[Code] ....
The first loop is supposed to dynamically assign the tag value, with whatever the textbox value is, however it doesn't. I've asterisked out the line i think may be the issue.
View 10 Replies
View Related
Oct 7, 2013
I am using an unbound textbox at the top of my form for filtering purposes. The user types in a string and hits "Tab" which kicks of the filter which is defined in the AfterUpdate property. I want the focus to return to the same textbox and position the curosor after the last character. I am trying to use SelStart but not having success.
Code:
Me.Filter = "COURSE_NAME Like '*" & Me.txtFilter & "*'"
Me.FilterOn = True
txtFilter.SetFocus
txtFilter.SelStart = txtFilter.SelLength
View 9 Replies
View Related
Oct 2, 2007
Hi,
My property sheet has disappeared I don't know what I did. How can I make it reappears? I have try by pressing the SHFIT key but it won't work. Also, I have created a new database and open it, the property sheet isn't appeared. The icon are still there but when I press on it, it does not response.
Thanks,
Le
View 10 Replies
View Related
Dec 14, 2012
I'm working on a query that lists all the queries in an Access database, and I would like the query to show the object description which is displayed when you right-click an object and display the object's properties. For queries, this is a text box just below the query name in the properties window.
So far, all I have is:
Code:
SELECT ID, Name FROM mSysObjects;
I would like to have something like:
Code:
SELECT ID, Name, Description FROM mSysObjects;
View 3 Replies
View Related
Aug 27, 2007
Is there a way to change the background color of an field that has enable = off from the default "gray"? I can set it to transparent but I can't change the font color to see the data clearly.
Just trying to make the form "nice looking" to the user.
Thanks
Jeff
View 1 Replies
View Related
Oct 28, 2005
Hello,
I've sorted out a problem that I had with a Form that had a subtable on it, by setting on the properties of the form for the 'Order by' criteria to equal the Id number of the form. eg: if each record has an Idnumber I have put [Idnumber] as the Order by property.
I have no idea what this does though, even though it seems intuitive? it's a form... so what is there to order? hope i'm not just being very stupid!
Thanks
Peter.
View 3 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
Jun 13, 2006
I am very new at Microsoft Access. I have two forms, A and B, that are filled out by two different users. Form A gets filled out first than form B gets filled out. Each has a name box as well as a birthdate box and a few other similar text fields. However, each form also has a few distinctive fields. I was wondering how I could input the common information in Form A to Form B so the user of Form B does not have to spend time retyping the name and birthdates again. In other words, I want to synchronize the similar records between the two forms. I would like the values to appear in a table as well. I would greatly appreciate it if someone could help me with the visual basic code. Thank You.
View 1 Replies
View Related
Feb 17, 2005
This seems really straight forward to me. I have 3 forms - FormA, FormB and FormC. When I open FormA the user inputs some information, when they tab to the last field, FormB opens (which I want to be invisible) and Form C opens.
I've tried putting this coding on the Open event of FormB:
Me.Visible = False
I've also tried putting this code on the Open event of FormC
Forms!FormB.Visible= False
Neither work. My form (FormB) still displays when eithr event occurs.
Any suggestions?
Cindy
View 6 Replies
View Related
Nov 23, 2005
I have a DB with 20 forms. All of the forms are closed. I opened a new form and added a button. I would like to do the following when the button is clicked:
Check the "Tag" property of each form and count whichever is not null.
Can anybody help me out??::o
View 1 Replies
View Related
Nov 18, 2006
Hi All,
I have been searching and can't seem to find how to solve my problem. I have a sub form that allows adding new rows to a database. The detail contains a combobox and a few text fields. When I enter data everything works fine. However when I accidently tab into the next row (new blank row) and then try to get out of the form without adding a new row I get an error about "Index or Primary Key cannot be null" or something like that.
It is very frustrating because I can't exit the form until I add data to the new row and then leave without tabbing to much (thus creating another new row with no data).
How do I trap the new row and only allow the insert if it has data in it?
Thanks.
View 1 Replies
View Related
May 25, 2015
I've saved a form to an text file to investigate a corrupted form issue. The output text file has below extracted text. I am wondering where I can find the TOP, RIGHT BOTTOM property of the form in design time? I could see some properties such as GridX, GridY, but not sure where are TOP property.
Version =20
VersionRequired =20
Checksum =-1566200859
Begin Form
RecordSelectors = NotDefault
[Code] ....
View 3 Replies
View Related
Dec 3, 2013
I have the following code:
Dim FrmGraphObj As Object
Set FrmGraphObj = Forms![frmE Weekly Efficiency]![gph_WeeklyEfficiency].Object.Application.Chart
FrmGraphObj.Axes(xlValue).TickLabels.NumberFormat = "0%"
I continually receive a runtime error 1004 " unable to get tick labels property of the axis class"
if I remove this code, then I error on the following code:
Dim FrmGraphObj As Object
Set FrmGraphObj = Forms![frmE Weekly Efficiency]![gph_WeeklyEfficiency].Object.Application.Chart
If FrmGraphObj.SeriesCollection(2).HasDataLabels Then
also a runtime 1004: "unable to get the seriescollection property of the chart class" on the last line above
searched this forum and found:
If your chart is in a form (or report), you have to:
1) refer to the form (or report) name (Form_Charts)
2) refer to the name of the object frame holding your chart (.Graph1)
3) refer to the object within the frame (.Object)
4) refer to the application that created the object (.Application)
5) refer to the actual chart itself (.Chart)
6) refer to the axes collection and select the axis you want to reference - in this case the category, or X-axis (.Axes(xlCategory))
I made the assumption, that I would just replace xlCategory with xlValue for the Y-axis. So I'm back to:
Set FrmGraphObj = Forms![frmE Weekly Efficiency]![gph_WeeklyEfficiency].Object.Application.Graph
With FrmGraphObj.Axes(xlValue)
.TickLabels.NumberFormat = "0%"
End With
Same error....
Looked in the Microsoft Graph Visual Basic Reference and it indicated:
"Tick-mark label text for the value axis is calculated based on the MajorUnit, MinimumScale, and MaximumScale properties of the value axis. To change the tick-mark label text for the value axis, you must change the values of these properties."
I reset my code to call these 2 functions prior to changing the number format.....
Public Sub txtMaxPercent_AfterUpdate()
Dim FrmGraphObj As Object
Set FrmGraphObj = Forms![frmE Weekly Efficiency]![gph_WeeklyEfficiency].Object.Application.Chart
FrmGraphObj.Axes(xlValue).MaximumScale = txtMaxPercent
End Sub
Public Sub txtMinPercent_AfterUpdate()
Dim FrmGraphObj As Object
Set FrmGraphObj = Forms![frmE Weekly Efficiency]![gph_WeeklyEfficiency].Object.Application.Chart
FrmGraphObj.Axes(xlValue).MinimumScale = txtMinPercent
End Sub
now I am receiving error 1004 again, this time it states "Unable to set the minimumscale property of the axis class" erroring on this line....
FrmGraphObj.Axes(xlValue).MinimumScale = txtMinPercent
debug.Print me.txtMinPercent
0.51
View 2 Replies
View Related
Mar 21, 2006
On one of my forms two of the fields are "Date Contact Initiated" and "Date Contact Concluded". I have the property for this field set to Short Date.
These two fields autofill with the current date when the form is opened. When the date for both of these fields is the same there is no problem. When the "Date Contact Initiated" is different from the "Date Contact Concluded", the user has to manually go to the "Date Contact Initiated" and change the date ( most often to the previous day.)
What is causing some confusion is that when they go to the "Date Contact Initiated" field to change the information it displays not only the autofilled date but also the autofilled time. There is another field on the form where the time for the contact initiated is to be entered.
Is there a way to format this date field to only show the autofilled date and not the autofilled time?
Thanks for the help!
Chris :)
View 2 Replies
View Related
Nov 3, 2014
I want to set the size and shape of my forms to exactly fill a screen at a particular screen resolution. I can only see a width property in inches and nothing in pixels. Is this possible?
I know I can set the fit-to-screen property to yes but this isn't what I want. I don't want a form to fill a screen at any resolution. If a screen is a higher res than the size I've formatted the form for I want it to appear the same size on the higher res screen (i.e. with a border of background around it.)
Is this possible?
View 5 Replies
View Related
Jun 26, 2015
How to set all controls in the form I would like to get complete information about all property options.
View 6 Replies
View Related
Oct 16, 2013
I'm using access 2010.
How to set a single form's property to act as it's own "overlapping window" in a database that is set to use tabbed documents. I want most windows to have the tabbed layout but there are a few that I would like to have pop out and be their own windows.
I noticed that the Northwind database did this somehow. if you click on one of the products from the home screen a form pops up in its own window. I tried reverse engineering it, but no luck so far.
View 2 Replies
View Related
Apr 12, 2007
I have created a Word Doc which is a help file for the new users. I tried to paste it in a new form but it takes only a few lines whereas the Word Doc has five pages. Is there a way to embed/link/paste this help file to my Access DB? Grateful for help.
View 1 Replies
View Related
Apr 5, 2015
I have 1 combo box and 1 text box i look up 2 columns in the combo box from that combo box i want to look up 2 column to text box
example:
Table values:
Col 1 Col 2
A 1
A 2
combo box successfully look up 2 columns but i look up to text box
Formula: =combo1.column(1)
But the text box look up the first row always even i choose the second row A
Also look-up first row 1
Any solution to look up 2nd row?
View 3 Replies
View Related
Sep 4, 2013
I am close to getting code to send an email from access with the body of the email populated with a Rich Text textbox from my access form. The problem I am having is that the body of the email is converted to plain text in Outlook which is creating problems for me. How to identify what I can do to convert to rich text or HTML in Outlook? I also want to attach a table that is populated by a query in my application, but i haven't got that far yet.
View 5 Replies
View Related
Jan 8, 2015
Is there a way to add a validation rule in an access form on an unbound text box. This box is currently doing a calculation of others. If the figure is not between 0 And 0.3125 then I do not want the user to be able to move on. For some reason if I enter "Between 0 And 0.3125" in the validation rule it doesn't seem to do anything. I can only assume its because its an unbound text box. Data attached please see Frm_Input and text box total standard hours.
View 4 Replies
View Related