Queries :: Using Variable In A List Field Query - Getting Complete List On Initial View

Mar 28, 2014

In my access form I provide the user a list of locations from various countries in a listbox . But the list is too long so I provide him a combobox for selecting a country. Selecting the country should update the listbox showing only the locations in that specific country.

So my SELECT from the listbox must cover the unselected state and show all entries and when a country is selected it must narrow the selection.

I tried to get this happen with the following SELECT statement containing a variable. Choosing a country in the Combobox results in a change of the variable and in a requery. This works after the first country is selected and for each country change, but the initial list is empty.

VBA in the loadform
'Application.TempVars.Add "varcountryselect", "*"
SELECT in the listbox "lstlocationsperproject"
SELECT tbllocations.locationID, tbllocations.country, tbllocations.localstreet, tbllocations.localcity FROM tbllocations WHERE ((tbllocations.country) Like [TempVar]![varcountryselect]);

VBA in the combobox
Application.TempVars("varcountryselect") = [Form]![kombcountryselect].Column(0)
Me.lstlocationsperproject.Requery

The values in [kombcountryselect].Column(0) are texts like "SPAIN", "MEXICO", etc.

Any hints, how I have to use the * for getting the complete list on the initial view ?

View Replies


ADVERTISEMENT

Getting A Complete List Of Files And Folders

Nov 26, 2006

I'm trying to get a complete list of folders within a given Folder but can only get it down to the level of the main folders sub folders but should a sub folder also contain folders it misses these.

My code below builds a list like:

c:fld1fld2fld3

This function is used to fill a combo box


Function ShowFolderList() As String
Dim fs, F, f1, S, sf, All, AF, FC, sb, sb1, sbf, sbc
Dim Lst As String
Lst = ""
Set fs = CreateObject("Scripting.FileSystemObject")
Set F = fs.GetFolder(Me![FoldersRoot] & Me![StartInFolder])
Set sf = F.SubFolders
For Each f1 In sf
Lst = Lst & f1 & ";"
Set sb = f1.SubFolders
For Each sb1 In sb
Lst = Lst & sb1 & ";"
Next
Next
'Now Remove The Last ; If Their
If Right(Lst, Len(Lst)) = ";" Then
ShowFolderList = Left(Lst, Len(Lst) - 1)
Else
ShowFolderList = Lst
End If

End Function

View 3 Replies View Related

Field List Window Displayed In Form View

Jul 8, 2014

I have a form with a subform that has started a strange behavior... Periodically (no apparent pattern) whenever I leave the form (go to next record, print report, send an email...) the field list (Add Existing Field) box pops up. I always thought that those boxes (property sheet included) displayed or were hidden based on the state the last time it was used in Design View. I have confirmed that all forms and subforms do not have the boxes in display state in Design View.

I can go into Design View, close the box and all is well for awhile. It seems to happen more frequently when I go to print a report based on the data on the current form. My question is - what causes the Field List or Property Sheet to toggle on/off and can I suppress it either on a form or in the VBA code?

View 3 Replies View Related

Queries :: Using Field List Combo Box To Set Field Names In Query

Apr 24, 2013

I’m developing a claim tracking database that tracks dates of events that occur in the course of processing a claim; such as, Loss Date, Report Date, Estimate Date, Payment Date, etc. There are 16 different “Events” in all.I currently have the following tables set up:

tblClaim
ClaimID
ClaimNumber
fkEmpID

tblEmployee
EmpID
EmpName

[code]....

What I need to do is create a form where management can choose two or more events, and calculate the average number of days between two of any of the events, for an employee, or all employees.I have created a crosstab query to change the values in the EventName field in tblEvents to field names, and the EventDate as values for the related EventNames. I created another query based on this query to do the DateDiff.

I created combo boxes on my form with the Row Source Type set to Field List, for a list of fields in my crosstab query. I’ve tried to use the following DateDiff function to get the days between the two fields selected in my combo boxes:

Code:
DateDiff("d",[Forms]![frmReportBuilder]![cboEvent1],[Forms]![frmReportBuilder]![cboEvent2])

But I get an error about unrecognized field name or expression for my combo boxes. So I added my combo boxes in the query parameter window, with a data type as both text and value, but with both I get an error “This expression is typed incorrectly or is too complex to be evaluated.” I also specified the column headings in the crosstab but I still am getting the “too complex” error.I’m pretty sure it’s trying to do a Datediff on the literal values in the comboboxes and not recognizing that I’m trying to specify field names.Is it possible to assign field names in DateDiff this way?

View 1 Replies View Related

Queries :: Multi-Select List Box As Filter For Query Field

May 16, 2013

On [Form1] I have a Multi-Select Listbox[List1] which shows Job Numbers [WBS] (The job numbers displaying are a result of a separate query filtered by the Fiscal Year combobox). When I click [CMD1] I want [Query1] results to only be selected [WBS] from the form.What is the best way to code this? I'm a beginner when it comes to VBA.

View 12 Replies View Related

Queries :: Form List Based On A Query Returns Original ID Value Not Field Text

Aug 14, 2014

I have a table x where the field value is selected via a combo box in a form that is populated from another table z.

When I look in x, it appears to have correctly stored the text from z, not the ID number.

I then built a Query, qX, which looks in x and grabs the fields I want. That query shows the text correctly in each selected field.

Now when I build a form, frmQx and use a List control, it displays some of the fields as ID values from the original table z, not the text values.

How can I get round this? I've searched and searched for an answer, sigh. Maybe I'm just not quite certain how to phrase the search.

View 5 Replies View Related

Queries :: Produce Query Using Combo / Pick List Field Held In Main Table

Jun 17, 2014

My computer has been updated to 2010 whilst I've been off sick (was 2003 before my accident).

I've created a main table, for devises across the company, and a combo box/selection box based on another table which holds a list of all the "Responsible" employee's aswell as another combo box/selection box for the device location.

So the person entering the information, can enter all the information for a device (torq wrench, socket set etc), who is responsible for it and which department they belong to (where to find the device).

Which all works fine

However, I'd like to create 2 queries, one to enable the user to run a report of all device's allocated with an employee or to be able to run a query for all device's stored in a particular department.

But I have been unable to set the correct query criteria, to enable to query user to be able to selection from a drop down list, which responsible person or location to pull back the correct list.

I was getting an error asking me to set the parenthesis, I have now deleted criteria for both queries, as even if I put [Enter] and type a Responsible person's name exactly as its held on the table, the report comes back blank.

View 1 Replies View Related

Query To List Multiple Records In A List From Multiple Queries

Jul 11, 2013

I have a DB where you there's 5 tables all linked together by one project ID

tables below

Project , Staff, Asset, allowances, travel, mark up

What I can do is create a new project, then add records to each of the other tables on what different items I require,

i.e. I create a new project - called project one, in the project table I create a record stating, name, time scale, client and location, then I add different records to each of the other tables on what I require all linked to the same project ID. (probably not explained that too well)

Now I want to create a query that lists all the requirements one after the other this will make it easier to create reports and to calculate costing's.

At the moment I have made 5 different queries listing all the data, then have one report containing 5 sub reports to display the data, no this does work.

View 7 Replies View Related

Queries :: Return List Of Records From Original List

Apr 23, 2013

I'm looking to move an excel sheet to access because the row counts are too much.The main thing it does is compare the supplied data against a list I hold in the sheet.There are not duplicate records, however..Some data is a direct lookup for a full match, but much of it is a count to see how many records contain a certain string.

I have 500 keywords which have a countif function in using wildcards.I need to create a query/report which will return a list of records from the original list which contains each keyword featured and how many times it features.I was going to do it in PHPmysql but the time it took to parse a million records for every keyword made it pointless.

eg:
keywords:
look
billy
magic

list:
"have a look and see"
"spanish dave"
"who is billy brag"
"looky looky I go hooky"
"who's the man from argentina"
"could it be magic now"

my spreadsheet would return a 1 next to ""billy" and "magic" and would put a 2 next to "look".

the sheet has the keyword in each row and next to the column:
=COUNTIF(list,CONCATENATE("*@",B13))
where "list" is the external data.

View 3 Replies View Related

List Table, Limiting Field List..

Oct 14, 2006

Okay,

The subject is probably confusing but I'll try to explain.
Setup:

Table1
FieldID = Number
FieldName = Text

Table2
FieldID = Number
FieldName = Text
T1_ID = Number

Relationship
Table1.FieldID 1-> * Table2.T1_ID (one to many)

Now, I'm trying to create a 3rd table that has field populated by Table1 and a field populated by Table2 but I want to limit the field populated by table2 by what is selected in the field populated by table1.
Table1:

1st
2nd
3rd
4th

Table2:

1st,January
1st,February
1st,March
2nd,April
2nd,May
2nd,June
3rd,July
3rd,August
3rd,September
4th,October
4th,November
4th,December


Table3:
Table1Field = Number, ComboBox-Source: Table1, BoundColumn=1
Table2Field = Number, ComboBox-Source: Table2, BoundColumn=1

If Table1Field = 1st then
Table2Field Will only allow January, February, or March as selections, since ONLY they are a member of the "1sr" group via the table1 list.

Is this possible, or do i have to do some run-time checking or something?
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner

View 1 Replies View Related

Queries :: Updating Child Table List View On Change Of Main Table Row

Apr 19, 2013

Here's a query that the bottom listview in the attached form i.e. a listview representing a table of calls(many) to fims (1 top listview)

Code:
SELECT calls.id, calls.firm_id, calls.called, calls.said, calls.spoke_to, calls.next
FROM calls
WHERE (((calls.firm_id)=[firms].[id]))
ORDER BY calls.called DESC , calls.next DESC;

When I run the thing...I get a dialog asking me for firm id.

I want to change this so when I move up and down the firms LV (top)... the bottom LV updates taking firm id from the top LV with focus.

Access 2003.

View 2 Replies View Related

Not In List, Requery, Save Variable

Dec 13, 2004

Hi. I just ran across this forum. It looks like I could learn alot here.

I have been searching for some code, and have found two of the three items that I need to make this work. To make this simple, I have two forms and two tables. One form for Contacts (with addresses) and one form that has the Contacts information together with a list of their responsibilities. Say I have the Responsibilities form open, and type in a contact name in an unbound combo box. I believe this was the case, as the unbound combo box was being used to update the contact information down below on the form. I'd like to invoke an event procedure if the contact isn't in the list. I've found various vbscript to handle this in the "not in list" property. If they are not in the list, I'd like it to save the name typed in, open the Contacts form to add the new contact and their information. This I have done. When I close that form, I'd like the procedure to go back to the original Responsibilities form, requery the table (or is it really requery the combo box?), insert the new name into the combo box, and update what contact information resides on the Responsibilities form.

I've seen info on the requery portion, as I've run into the same problem of the name not being in the combo box, unless I close the Responsibilities form and then open it back up.

But I haven't seen an example where everything is put together with saving the contact name (as a variable???) and then putting the contact name in the Contacts form and then back in the combo box on the Responsibilities form.

If someone has an example, or could steer me in the right direction, I'd sure appreciate it. I understand some of this stuff, but don't really have the vbscript understanding. But I'm good at using examples with prewritten code and manipulating to work with my forms and field names.

Thanks in advance for your advise.

Rob (Wannaxlr8)

View 2 Replies View Related

Queries :: List Field Result In One Row

May 3, 2013

How can list the contents of one field columns in one row in a report.

Example:
ID: 1
A1
A2
A3
A4

Should be: ID1 - A1, A2, A2, A3, A4

View 3 Replies View Related

List View

Dec 13, 2005

I have a list view in my form

I add new rows in the list view by code

here is my code:


ListView.HideColumnHeaders = True

With ListView.ListItems
.Add , , name_book, , 1
.Add , , name_pupil, , 3
.Add , , MAX_DATE, , 4
.Add , , KAT, , 5
.Add , , "__________________________"

End With


my problem is that when i add more value, the new value add at the bottom of the list view that I cant see it just have to use the scroller.

is it possible to add new value but to see it on the top, that in the list view I see the new value and to see the old value I use the scrollers.

thanks!

View 1 Replies View Related

List View SP2

Aug 31, 2006

Hi

I am using MS ListView SP2. While designing the application, I did it in my local drive. Since it is multi-user application, I have put it in a shared folder. The issue that it gives an error that there was an error loading ActiveX control on your form.

Has it to do with reference? Do I have to give reference in all the machines ?

View 2 Replies View Related

Queries :: Field Did Not Appear In The List Of Fields In Design Definition

Aug 4, 2014

I have a query based on a query, when I added a new field to the base query, this field did not appear in the list of fields in the design definition when I try and add to the upper query. It just shows the original fields only.

Same thing happened in a field on a report - I had to delete the field and create it again...

View 4 Replies View Related

Modules & VBA :: Find Field Listed In Queries And List Them

Oct 11, 2013

I have no experience with Access Modules which I think I need to find all the queries that reference a field, in this example: LAWSON_LHSEMPDEMO.R_STATUS

I would like for the module to list all the queries for me that reference this table and field of "LAWSON_LHSEMPDEMO.R_STATUS"

Is there an easy way to do this?

View 4 Replies View Related

Queries :: Extracting Data From List In Separate Field

Sep 19, 2014

695515*97
531924*11
495853*131
377035*181

Is there a way to extract the 97, 11, 131, 181 numbers from the above list in a separate field?

View 1 Replies View Related

View Table Fields In A List Box

Feb 20, 2005

Hello, I'm having a spot of bother ....

I have a form that populates, in a list box, the tables within my Access database when it opens. I need to be able to do the following;

1 - Populate another list box on the form with the field names of the table I've selected

2 - Check to see if the table has a specific field, and if not, add that field to the table

Is there anybody out there that has done something similar or knows how to do this?

My programming skills are fairly basic, so I would appreciate an example of the code.

Thanks in advance.

View 4 Replies View Related

List View DblClick Event

Sep 1, 2006

Hi
I have placed a ListView on the form. I have written a DblClick event for the ListView. The application is a multi-user one. The issue is that the DblClick event was working for few days and now it does not work for any of them but it is working only in my system.

Is it related to reference ? I developed the tool on my system and placed in a shared folder from which everybody uses. Do I need to give reference in all the system ? Please help. I am stuck with this problem.

View 1 Replies View Related

Modules & VBA :: Reads List Of Files Sequentially - Check For Variable In A Table

Aug 2, 2013

I have a process that reads a list of files sequentially and then processes them .... As each file is processed, its name (strfile) gets written to a Table (Vault.[Processed_file])

I want to verify if the file exists in the table prior to processing it - if it exists, I won't process it again ...

View 5 Replies View Related

Modules & VBA :: Datasheet View - Check Box In A List Box

Jul 9, 2014

I dont know if this is possible but I want to change a yes/no field from a list box.

I can load data in fine I can even loop through it to see what value each item is but, is it possible to allow a user to change a value from a list box?

If not do I have to use the Datasheet view?

View 5 Replies View Related

Forms :: Property List In Datasheet View?

Jul 4, 2014

I want to avoid the properties list to pop out when a form is viewed in dsview. I remember there was a property to set that but I cannot find it.

View 3 Replies View Related

Forms :: Checkbox To Control List View Using VBA

Sep 21, 2014

I have a form (frmHourEnter) with a combo box (Staff_ID) that lists staff members from a table (tblStaff). The table form (frmStaff) has a checkbox (ckEmploy) which indicates if a staff member is still employed. If the checkbox is checked how do I exclude that staff member from the combo box Staff_ID in the form frmHourEnter?

View 8 Replies View Related

Set Field In Query As Value In List Box In Form

Jun 21, 2005

:confused: I've tried everything I can possibly think of to get this to work. I've also looked at other threads and I still couldn't get this to work. The code for the list box in my form is Forms!Display_Engineering_Jobs_Report_Inputs!Repor t_Column1. I am trying to set the value in this list box as the input for the field on my query. This value also corresponds to a heading within a table I have. The information under the heading in this table is what I am trying to show in the query. Please help! Also, I'm pretty new to Access, so explain it as if you were writing a page in "Access for Dummies." Thanks!

View 9 Replies View Related

Forms :: Not Empty List View At Form Load

Oct 29, 2013

I have created a form with a list view (active-x) to be able to control colors, etc in a list.

When I open my form, it is already information (three rows) in the list view. This despite the fact that I have shut down the access application and even shifted the database to another computer.

I can of course delete the elements with ListItems.Clear when I open the form, but I'd rather like that they did not show up at all.

Where these "default-elements" are stored, so I can remove them from the list view once and for all?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved