Three Listboxes From Same Table Issue

Jun 14, 2006

hi guys, i was wondering if you can help me. I have a data entry form in which the user has three listboxes from an existing table (only one table for the three listboxes). however if the user selects the same item from listbox1 in listbox2 or listbox3, i want him to get an error message and don't let that happen. how can i do this? vba code?:confused:

this is my form:

Please select your three items of choice.

1st choice 2ndchoice 3rdchoice
listbox1 listbox2 listbox3


listbox1.value cannot equal listbox2.value and cannot equal listbox3.value.

View Replies


ADVERTISEMENT

ListBoxes Again

Mar 5, 2008

Hi,

i am looking for advice on listboxes. i have various books which all happily state everything exept how to use them!!

1st advice-

i need to know how to create an SQL statement on the listbox so it shows filtered dsata from a query. i am trying to filter by date so the list box could show multiple items carried out on the same date. is it:
SELECT Query.Field From Query Where Field

2nd advice-

a listbox shows data based on a query showing payments. i click on the payment in the listbox and a form opens with the specific data showing.
i have looked around but cannot find much on them.

help would be gratefully received as im currently stuck.


thanks,

NS

View 4 Replies View Related

Dynamic Listboxes

Jul 17, 2005

Hello,

I have two tables: Categories and Subcategories.

Categories contains one field: CategoryName
Subcategories contains two fields: ParentCategoryName and SubcategoryName.

In a third talbe I want to select a category from a listbox, then have the subcategory listbox update automatically with the possiblities. Is this possible?

Thanks.

View 1 Replies View Related

Linking 2 Listboxes

Sep 1, 2007

Maybe somebody can help me with this... in my form I have two listboxes, first one to select the name of the client and the second one to select the contact person of the client... both are linked to a seperate table...

first listbox works fine, only the second one gives me troubles... in the source query I link the ClientID to the ID of the first listbox with...

Forms![PRODUCTIONS]![ClientID]

when I run the form, I get all the time a message window on my screen with the text Forms![PRODUCTIONS]![ClientID] and asking a value for it... I think that I do something wrong with getting the ID from the first listbox....

can somebody help me with this what to do ?

View 2 Replies View Related

Populating Listboxes

Feb 11, 2005

Hi,

Trying to populate a listbox using a .txt file created used WORD. This is the code i'm using:

Private Sub cmdDisplayFile_Click()
On Error GoTo text_open_error
Dim sTemp As String
Open "m:myaccessumber.txt" For Input As #1
Do While Not EOF(1)
MsgBox ("in loop")
Line Input #1, sTemp
lstShowTextFile.AddItem sTemp
Loop
Close #1

I'm getting nothing in the ListBox. Any hints would be much appreciated.
text_open_exit:
Exit Sub

text_open_error:
MsgBox Err.Description
Resume text_open_exit

View 2 Replies View Related

Hi! I Need Help With Comboboxes, Listboxes...

Dec 5, 2006

I have a form with many combo and list boxes, but i don't know how to find a relation between them. I want to select a name of a product that is in a combobox and then a list or text box will show its description.... Please help me because I will burn out sooner or later :eek:
KD:confused:

View 12 Replies View Related

Issue About Listboxes!

Oct 27, 2005

Hi
I have an Access form. I have a listbox that has the value pulled from a query. I also have a button on the form. When i click the button, the value from this listbox should be appended to a table. So I am trying to do this by referencing this listbox value as Forms!subform!listbox.value . This is storing the value of null. any idea of how to capture the value that is stored in a listbox.

Thanks
Neelima.

View 3 Replies View Related

Text Align ListBoxes

Jul 20, 2005

Is it possible to align text inside a multi column list box.
For example, currency field is always aligned to the left
where it should be right aligned.

Kappler

View 1 Replies View Related

Viewing Listboxes In A Report

Nov 19, 2005

Good Morning all,

On a Form I have a series of Listboxes, each drills down to a final piece of information. The Listboxes store a number_id which displays along with other information In this case the number_id is associated to a TEXT description. When I send the Listbox info to the Report it displays the info but the text doesn't wrap and it gets cut off. There is no "can grow" option on a list box.

So I need to create a Text Box in the Report but when I refrence the listbox in the control source only the number_id shows up. I need to see the associated text (field).

Any help would be great!

Thanks,

Phil "bones"

View 2 Replies View Related

Multiple Multiselect Listboxes

Feb 18, 2006

Hi, my problems are numerous!
I have a form with a number of multiselect listboxes. Their sources are individual tables such as YEARS, PARISHES, CLIENTS. The underlying data is stored in a separate table. I want users to be able to select none, one or some values from each listbox and run a report.
As simple listboxes with one selection permitted this worked fine. I know that my problem is in concantenating the values.

I have tried attaching some code to the OnClick function of a cmd button on the form. I found this code referred to a number of times here and have tried to adapt it but no luck. I have now reduced my form to one listbox to test stuff out- this is the code-

Dim frm As Form, ctl As Control
Dim varItem As Variant
Dim strSQL As String
Set frm = Form!testform
Set ctl = frm!lboparish
strSQL = "Select * from StJamesAgric where [Parish]="
For Each varItem In ctl.ItemsSelected
strSQL = strSQL & ctl.ItemData(varItem) & " OR [Parish]="
Next varItem

'Trim the end of strSQL
strSQL=left$(strSQL,len(strSQL)-300)

The first error I get is "can't find field 'testform'"

My form is called testform
The listbox is called lboparish
The table with all the data is called StJamesAgric

What am I doing wrong???? And also, if this code EVER works, do I need to repeat it for each listbox or do I insert refernces to each list box within just one subcommand?

Any help greatly appreciated.

Stella

View 5 Replies View Related

Scroll Bars In Listboxes

Jan 7, 2005

In the forms that I have made, none of the listboxes ever scroll with the mouse scroll wheel. I have tried to click into the listbox first to ascertain that the focus is in the listbox but nothing works. the only way to scroll is to manually drag the scroll bar tab.
I want to find out how i can make my scrolling work. I guess that there must be a global setting somewhere to switch it on or off... Any insight into this will be highly appreciated!

View 1 Replies View Related

Listboxes In Access For Beginners

Apr 10, 2006

I'm not a programmer by any stretch of the imagination. I'm having an issue I could use a little pro help with.

I have a listbox called "ListDIV" on a form called "fRptCriteria". I am trying to have a query called "qOpenOrds" look to the listbox for some parameters. The field on the query is called "DVNO2Y". The form also contains serveral Calendar Controls "SDate" and "EDate" that the query is looking at too.

In the past, I've had no difficulty referencing a Combo box, but the is listbox issue is driving me nuts!

Thanks in advance.....

View 5 Replies View Related

Search Form With Cbo And Listboxes

Mar 28, 2007

Hello,

I would like to create a search form with four combo and a listbox which would display the result of the combo.

All combos get data from Table1.

I would like to add:
cboSSN
CBOLNAME
CBOFNAME
CBODOB

When users will select a SSN, then CBOLNAME will return all records showing a the same Last Name with data SSN.

If users will select cboLNAME, then CBOFNAME will return all first names of the records with that specific Last name.

Is there a way I can do this or same example? Thanks.

View 1 Replies View Related

Dependent Listboxes With Criteria

Jan 11, 2015

I have a form that has two listboxes. The first list box is named "lstType", which pulls in information from a table tblType. The second or dependent listbox, named lstSName, is then filtered and only shows the SName that match the type. This is pulled in from a table "tblSName." Using the form filtering on the query "[Forms]![frmqryTask]![lstType]"

This portion actually works perfectly and filter my form as I wanted it too (at least originally). However, I realized a few days ago that the when clients or the SName does not have any active projects my company will be working on for them, we don't want don't need to see their name on the forms listbox called "lstSNameand", so we want change a status from "Active" to "Inactive". I've already added this status in as well.

What I'd like to have happen is that when using the dependent listbox, the lstSName will only show those with the "Active" status. I've tried adding the status = active onto the query, however I get a error message saying the query is too complex to run, which I'm guessing has something to do with the "[Forms]![frmqryTask]![lstType]" on the query.

View 9 Replies View Related

Forms :: Move Selected Between Two Listboxes?

Dec 16, 2013

Move Selected Items Between Listbox1 (listEmp) and listbox2 (listAllocated). the items moved from listEmp must be removed from listEmp when moved to list allocated and vice versa.

Overview:

listEmp is my first listbox and currently has the query in it's rowsource
SELECT e.* FROM qryEmp AS e;
it has 7 columns but only 6 are showing (Column 1 is hidden)
and it is currently bound to 1

listAllocated has only 4 columns (can be changed) i only need the first 4 columns from the first list.
currently it has no row source and the row source type is set to Value
it is also bound to 1

I did find some code that does not do what I need but is closer than anything that I have found so far. It seems like it is copying the Selected Items from Column 1 and pasting it in the second listbox. but it is pasting them all in a row and not in individual columns below is the code. I will post a screen shot in 2 posts time.

Code:
Private Sub cmdCopyItem_Click()
CopySelected Me
End Sub

[Code].....

View 7 Replies View Related

Modules & VBA :: Using Listboxes To Organize Records

Jun 27, 2014

I have a form with 2 listboxes: 1 to show the name of the products having a code "v" (recordsource query), 1 to show the name of the products having a code "a".

2 arrowed buttons (left-right) would make a product "jump" from one to the other.

The way I wanted to do this is, when the appropriate button is clicked, the actual product code is changed, then the listboxes refreshed, so that it looks that the product jumped listboxes (when the code changes and the listboxes refreshed/requeried, it will disappear in one and appear in the other, because of the recordsource queries).

I want to do it this way, because it is imperative that the code gets changed!

But how to get the record of the selected product "out" of the listbox. When I select a product and check e.g. the ".value" of the listbox, it is "null"!?

So how to "get" the record corresponding with the selected item in a listbox in VBA?

View 7 Replies View Related

Cascading Listboxes Not Updating Correctly

Nov 14, 2013

I am working on a very simple DB. The two fields in question are Country and City, both as text. The idea is that the user can choose one country from a single-selection ListBox and after selecting one country the Cities multi-selection ListBox gets populated through the following SQL search. The Table Country_City contains two rows with countries and cities, nothing complicated.

Code:
Private Sub BU_AfterUpdate()
'I deselect all the selected items
'*** WHY THE IS THIS NOT WORKING ???!!! ***
For i = 0 To AppliesTo.ListCount - 1
AppliesTo.Selected(i) = False
Next i
City.RowSource = "SELECT Country_City.City " & _
"FROM Country_City " & _
"WHERE Country_City.Country = '" & ListBoxCountry.Value & "';"

After I click/select a country on the first ListBox, the second does get populated correctly. The problem I am having is if the user changes the country, then the previously selected city/cities still stay selected. I tried to reverse that by deselecting all the cities each time I change the country, but the for-next loop does not seem to be doing the job. The funny thing is that if I paste those three lines on a buttom and click it right before selecting another country, it does work.

Example:
1) I select "France" on the first ListBox.
2) I select "Paris" and "Lyon" on the second ListBox.
3) Now I select "Germany" in the first ListBox.
4) The second ListBox gets filled by all the cities in Germany, but the ones I selected before (Lyon and Paris) appear on it too, selected.

I want to reset the selection on the second ListBox in case the user selects another country on the first ListBox.

Some information on the fields:
Country: Display Control=ListBox, Row Source Type=Value List, Row Source="France", "Germany"
City: Display Control=ListBox, Row Source=Table/Query, Row Source=(empty, updates with AfterUpdate event on Country ListBox)

View 1 Replies View Related

Combining Data From Multiple Listboxes?

Oct 4, 2012

I have created a DB who's sole purpose is to track employee availability and job positions available (a poor man's version of a scheduling database, if you will). I have 2 listboxes on one form. Listbox A shows all the employees available for work, and Listbox B shows the available work positions that require an employee. I am trying to create a functionality behind a button that will allow me to highlight one row in Listbox A and one row in Listbox B to combine the information in a seperate table (still not created) and refresh each Listbox to remove the entries. Similarly, I would also have to create functionality behind another button to undo the above, if needed.

View 1 Replies View Related

Need Help With Allowing Duplicate Selection For Transferring Listboxes

Jul 1, 2006

I found this sample (http://home.earthlink.net/~mgf00/SelectDemo.zip) which allows you to move your selections from one listbox to another with four buttons (<<, <, > and >>) which is just perfect.

Well, almost, actually.

This is already set up to protect against duplicates and that's a good thing. However in my case, my uppers want me to allow duplicates. The code is beyond my ability and my attempts only caused more problems.

The code requires a unique index be generated when the selection is moved between the listbox. Duplicating the index will cause error, and my attempt to circumvent that has either failed totally or is inconsistent (e.g. works if it comes up with a unique value, but will fail if it happens to duplicate a key).

Can anyone show me how I can modify the code to allow for duplicates? The selections then will be looped into a many side table.

View 5 Replies View Related

Forms :: Saving Selection From Listboxes To A Query

Aug 20, 2014

I am new to Access and I have get to where the users can make selections in the listboxes, but then I need to save the selection in a query or table to save thier changes.

View 1 Replies View Related

Modules & VBA :: Generate Dynamic Report From Listboxes?

Jun 6, 2013

Is it possible to generate a report from 2 listboxes?

I have attached a pic of what I am trying to accomplish. I am wanting to have a report open with only the criteria that a user selects from the listboxes.

listbox 1: User selects a case number(s)

listbox 2: User selects the fields they would like in the report

So, if the user selects:

Case number: 13-001

Then selects fields:

Allegation
Incident date
Focus_Last name

This report would be:

Code:
Case Number Allegation Incident Date Focus_Last Name
13-001 DUI 06/01/2013 Doe

View 5 Replies View Related

Forms :: Move Selected Items To And From Listboxes?

Dec 11, 2013

I have 2 Listboxes the first list is based on a query I need to select items from this box or part of each item and move to another listbox. the items in the second listbox will be used in a report. I have previously posted on another forum with no real luck fyi. the query is put straight in the RowSource.

View 3 Replies View Related

Reports :: Filter Report Using 3 ListBoxes (MultiSelect)

Apr 16, 2015

My table "EmpTraining" will store 5 fields:ID (PK Autonumber )
EmpID (From Employees Table)
FleetName_ID ( From FleetList Table )
Engine1_ID (From EngineList Table )
Engine2_ID (From EngineList Table )

At the point of adding a record to EmpTraining table , EmpID and FleetName_ID and Engine1_ID are Required, Engine2_ID is optional.

I am having trouble generating a Report Filter that will use 3 Listboxes(multiselect) and be able to limit the report by what is selected.

My Listboxes filter:EmpBase (from Employees Table)
FleetName_ID ( From FleetList Table )
Engine1_ID (From EngineList Table )

I am trying to use the Third listbox to filter both Engine1_ID and Engine2_ID and I think this is my main problem.

On the Filter form that has the ListBoxes I use a button to apply the filter to the report, the code for this Onclick event is:

Code:
Private Sub btnApplyFilter_Click()
Dim varItem As Variant
Dim strBaseStation As String
Dim strFleetType As String
Dim strEngineType As String

[code]....

How can I also make it filter the Engine1_ID and Engine2_ID fields .?

Or Should I store the FleetName/Engine1/Engine2 in a different way?

View 3 Replies View Related

Windows 8 Runtime - Listboxes Not Opening Records

Oct 24, 2013

I have a listbox that another subform on the same main pulls results from the column(0) id from (using text box that pulls the list record selected)

When you click once it (listbox) shows the records in the second form for the corresponding. When you double click it opens the record of the selected (listbox)

This works great in Runtime 2010 for all my 32bit staff and vista

however in 64bit win 8 with any runtime including 2013 64bit the database listbox works for a while, then slows and then stops opening the record on double click and when I say slows it slows to a crawl speed like it is looking up the query in the subform instead of just opening the record with the double click.

I was thinking mouse double click settings but they seem fine and as I said before it works fine for a while.

View 5 Replies View Related

Forms :: Listboxes With Separate Query In Continuous Form?

Dec 2, 2013

What i wish to do: list activities in a continuous form, and in one column display for each row a listbox which rowsource query is based on another column value from the same row.

I have to admit that the best thing for me would be to be able to create through vba a continuous form... is that possible?

View 3 Replies View Related

Queries :: Update In Table From Same Table Based On Criteria Column In Same Table

Sep 29, 2013

How can I update (some columns) in a table from the same table based on a Criteria column in the same table.

View 2 Replies View Related







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