Access Query Property From Form?
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 Replies
ADVERTISEMENT
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 4 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
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
Jul 19, 2005
I have an aggregate query that creates a report of "A" by "B". Each "A" can have many "B"s under it. The report works fine. I need to count and display on the report the number of "B"s for each "A". I can't seem to manipulate the "count" property of the query to generate the correct number. Little help??? Thanks....
Mike T
View 5 Replies
View Related
Apr 19, 2007
I am having trouble with a make-table query. I run a query that populates my website with data daily. I have a bunch of fields in the db that I wanted to be displayed as one field on the website, so in my query I concatenated them. My website is able to distinguish which fields are text and which are memos so I can display multiple lines. Everytime I run the query, it creates the concatenated field as a text field. Is there a way I can default this to a memo type?
Thanks.
View 1 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
Feb 7, 2008
Access 2003:
I have a query (qryGetRemoteStuff) like this:SELECT * FROM Table1 IN 'k:projectssomedatabase.mdb'I have several databases where i use this technique. I don't want to link these tables to my database.
According to the properties list, "Source Database" is used to store this path to my remote database.
So far so good.
When the path changes i am in a lot of trouble, that is why i want to change the path of this query dynamically. I don't seem able to change this property.
Is this possible? How?
Immediate window:
?currentdb.QueryDefs("qryGetRemoteStuff").Properties("SourceDatabase")Returns "Property not found". Access help F1 doesn't provide me with a workable example.
View 2 Replies
View Related
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 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
Jun 1, 2007
My db works well, it has been compressed/repaired & the code complied without any problems until I convert it to an Mde :confused:
The problem I have is that for some reason three of my sub forms will not function properly without getting this on click warning
The expression on Click you entered as the event property setting produced the following error:The expression you entered refers to an object that is closed or doesn't exist.
Visual Basic for Applications (VBA) encountered a problem while attempting to access a property or method. The problem may be one of the following:
A reference is missing.
For help restoring missing references, see the Microsoft Knowledge Base article 283806.
An Expression is misspelled.
Check all expressions used in event properties for correct spelling.
A user-defined function is declared as a sub or as a private function in a module.
Expressions can resolve a user-defined function only if the function is declared as one of the following:
- A public function in a module
- A public or private function in a code module of the current form or report
Security in Access is set to Medium or High and the Microsoft Jet 4.0 SP8 update is not installed.
A more recent verion of Jet 4.0 must be installed for Access to function properly when security is set to Medium or High. To obtain the latest version of Microsoft Jet, go to Windows Update.
I don't understand why there is a problem if it works fine without converting it to a Mde.
The 3 subforms do have one thing in common though
they have a cmd button that moves the focus to another object on the form & then the subforms visibility is set to false.
[Private Sub CmdClose_Click()
On Error GoTo 0 'Err_cmdClose_Click
If DCount("*", "tblTaskScheduleRates", "[SRLINKTask] = " & Me.Parent.TaskID) = 0 Then
Me.Parent.frmFlashRates.Visible = True
Me.Parent.cmdViewRates.Visible = True
End If
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Parent.cmdSaveRecord.SetFocus
Me.Parent.frmTaskScheduleRatesSubForm.Visible = False
Me.Parent.frmTaskScheduleRatesViewSubForm!lstAssig ned.Requery
Me.Parent!lstRevisedCost.Visible = True
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
End Sub
Private Sub CmdClose_Click()
Me.Parent.cmdAssignTask.SetFocus
Me.Parent.frmTimeRecordAssignSubForm.Visible = False
Me.Parent.frmTaskMessageViewSubForm!lstMessages.Re query
Me.Parent!frmSumTimeRecordsSubForm!lstAssigned.Req uery
Me.Parent!lstRevisedCost.Visible = True
If DCount("*", "qrySubbyFlash", "[TaskID] = " & Me.Parent!TaskID) > 0 Then
Me.Parent!cboTaskStatus = Me.Parent!cboTaskStatus.ItemData(1)
Else
Me.Parent!cboTaskStatus = Me.Parent!cboTaskStatus.ItemData(0)
End If
If DCount("*", "qryOperativeFlash", "[TTLINKTask] = " & Me.Parent!TaskID) > 0 Then
Me.Parent!cboTaskStatus = Me.Parent!cboTaskStatus.ItemData(1)
End If
End Sub
Private Sub cmdSave_Click()
If DCount("*", "tblTaskMessage", "[TMLINKTask] = " & Me.Parent.TaskID) = 0 Then
Me.Parent.frmFlashMessage.Visible = True
Me.Parent.cmdViewMessages.Visible = True
End If
Me.Parent.cmdNotes.SetFocus
Me.Parent.frmTaskMessageSubForm.Visible = False
Me.Parent.frmTaskMessageViewSubForm!lstMessages.Re query
Me.Parent!lstRevisedCost.Visible = True
End Sub
it works just fine as a normal database but for some reason it causes problems as an Mde.
any ideas?
thanks
View 14 Replies
View Related
Nov 8, 2013
In the default property of a subform control I want to use a control of the main form without using names of forms, but using me and parent.
I used in default property of cboVATDetail: =Me.Parent!cboVAT, but it is not accepted. My aim is to use cboVAT of parent as default in cboVATDetail of child.
View 3 Replies
View Related
Nov 15, 2006
I have a feeling that this is a silly question. But pls excuse me as i am a newbie and i have been beating abt this issue for 2 days and i have not been to solve it.
I made a form with 1 combo box, 1 buttom and a Grid DTC.
Now, for example. Taking the scenario of a car showroom.
By choosing the name of a brand or Company(like Honda) in the combo box and clicking on the button. I want to display every model(like Civic, Accord) that is available from that brand.
I wrote the query to do it in Queries part of access. It is working fine. But i am unable to write that query in the VB window that pops up when i go to the Events in the property of button.
Pls guide me
Thanks
View 2 Replies
View Related
Apr 18, 2007
Hi
We are a small Library just opened in our community, and the first one in our local area.
We are putting together an access query that will help aleviate the problems when our main library systems go down.
The database is a library records db. I want the query to ask the user for an author and a site and then to list all the records that match that query. Ideally i would like the user to be able to select a number of sites (from a possible 5), perhpas from a drop down type menu or checkboxes, type in the Author and then click on a button to perform the query.
Any help would be gratly appreciated - we are all beginners with access here.
Do you need to see what I have done so far? if so I could upload it for you.
Kind Regards
View 2 Replies
View Related
Apr 18, 2007
Hi
We are a small Library just opened in our community, and the first one in our local area.
We are putting together an access query that will help aleviate the problems when our main library systems go down.
The database is a library records db. I want the query to ask the user for an author and a site and then to list all the records that match that query. Ideally i would like the user to be able to select a number of sites (from a possible 5), perhpas from a drop down type menu or checkboxes, type in the Author and then click on a button to perform the query.
Any help would be gratly appreciated - we are all beginners with access here.
Do you need to see what I have done so far? if so I could upload it for you.
Kind Regards
View 3 Replies
View Related
Aug 24, 2005
Hi all. I am fairly new to access and am trying to do something that shouldn't be that hard. I have a simple form with one text box and a command button on it. I have the command button set to run an update query.
My problem is that when I enter data and press the button, I don't know how to get the entered data into the query?
I know this is simple to do, but since I am new to access, I can't figure it out. Does anyone have a simple example or step by step details that they can share with me?
Thanks
Chris
View 2 Replies
View Related