Forms :: List Box - Return To Top Without Selecting
Jan 22, 2014
I'm trying to create some VBA that will loop through my listbox, de-select all of the items, and then return to the top of the list without selecting the first item. Below is the code I am using based on what i was able to find through google, but the top item still remains selected.
Code:
With Me.AvailableAttendees
For SelRow = 0 To .ListCount - 1
.Selected(SelRow) = False
Next SelRow
End With
Me.AvailableAttendees.SetFocus
Me.AvailableAttendees.ListIndex = 0
View Replies
ADVERTISEMENT
Mar 22, 2013
I am currently designing an employee personal development and training database.I have 100 employees and the number that would go on a training course might be a handful so selecting four or five names in a subform list from a 100 seems a bit impractical.
I thought of selecting the course in a form from a combo box, selecting the employees using a tickbox in a subform and then running an append query.
View 6 Replies
View Related
Sep 11, 2013
I have a working combo box on a form that displays issue numbers for part number typed into a text box.This all works fine when the list of issue numbers is below the displayed list (16), but when the list is longer than 16 you cannot seem to select anything after item 16.
When the combo box has, say 25 items a scroll bar appears allowing the user to scroll down to item 25, but when you click the mouse the list just reverts back to the first 16 items? The only way to select an item after 16 is to select item 16 which then closes the combo box, then when you reopen it the list now shows items 17 to 25 which you can then select item 25.
This is the same in reverse, when you have item 25 selected, you cannot select item 1. When you click the mouse the list reverts back to items 17 - 25.The combo box is populated in code using the lost focus event on the text box for the part number.
View 7 Replies
View Related
Nov 13, 2013
I am relearning Access and having a little difficulty. I am creating a Access database that links tables from an I series system which I have done trouble free. In the database I have pulled up for example a patient demographic file (hospital). I have form frmSearch that prompts the user to enter the medical record number OR they can search by name. I have a query that takes that information then loads a 2nd form to display the query results in a list box. I would like to be able to click on one of the results from the 2nd form to then load another form that will display all of the patient information that was selected.How do you set this up so that with the results shown, I can click on one of them and it will load that patient into another form pulling the rest of his or her information from the table file?
View 12 Replies
View Related
Aug 4, 2014
I have a form where I have two drop down list box.The first list box is called Transaction_Type. It contains three values: Created, Allocated and Sold
The second list box is called Product_Status. It contains 6 items: Allocated, Produced, Reworked, Shipped, To Be Produced, Unallocated.
I have a products form. When a user created more inventory they will selected in the drop down list create, then a quantity. Then I would like the status of the product to update to "Unallocated".
When the user placed an order but doesn't finish it they will choose the status of the inventory to be allocated so I would like the product status to be updated to allocated automatically.
They other status the user will choose them self and do not need to be linked to each other.
In my vba code I have tried with the OnClick and AfterUpdate sub procedures with the following code.
If Me.Transaction_Type.Value = "Created" Then
Me.Product_Status.Value = "Unallocated"
End If
If Me.Transaction_Type.Value = "Allocated" Then
Me.Product_Status.Value = "Allocated"
End If
Yes when i select "created" from the drop down list it does not change product_status to say "unallocated"
(in using access 2007)
View 14 Replies
View Related
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
Feb 8, 2006
Hi All,
I have a database that has route lists for drivers,
I have a combo box that lets the user select a route and a timescale
and with that data it populates the list box,,,
The list box displays
Route Period Month
Now then,
I need the database to be able to double click on the list box and for it to preview a reoprt,
but i can work out how to set querry criteria from that command
Private Sub LstBox_DblClick(Cancel As Integer)
On Error GoTo Err_LstBox_DblClick
Dim stDocName As String
stDocName = "Rpt_Route_MAIN"
DoCmd.OpenReport stDocName, acPreview
Exit_LstBox_DblClick:
Exit Sub
Err_LstBox_DblClick:
MsgBox Err.Description
Resume Exit_LstBox_DblClick
End Sub
I've got a query set up that supports the report the two fields that need to be trasmited to the criteria of the query are :
1. Route
2. Timescale
View 1 Replies
View Related
Feb 8, 2006
Hi All,
I have a database that has route lists for drivers,
I have a combo box that lets the user select a route and a timescale
and with that data it populates the list box,,,
The list box displays
-- Route -- Period -- Month
eg -- 1 -- 6 montly -- jan, jul
Now then,
I need the database to be able to double click on the list box and for it to preview a reoprt,
but i can work out how to set querry criteria from that command
Private Sub LstBox_DblClick(Cancel As Integer)
On Error GoTo Err_LstBox_DblClick
Dim stDocName As String
stDocName = "Rpt_Route_MAIN"
DoCmd.OpenReport stDocName, acPreview
Exit_LstBox_DblClick:
Exit Sub
Err_LstBox_DblClick:
MsgBox Err.Description
Resume Exit_LstBox_DblClick
End Sub
I know i can use this to open the report but its not relevent to what has been clicked on
I've got a query set up that supports the report the two fields that need to be trasmited to the criteria of the query are :
1. Route
2. Timescale
Help Please
Thanking you in advance
View 1 Replies
View Related
Dec 20, 2004
i have a form that has a 6-column list box that displays results of a query.
I want that when the form loads, the first record is automatically selected in the list box.
I have a feeling that this should be something really simple... but I dont know how to go about it.
I will really appreciate all help!
View 13 Replies
View Related
Jan 17, 2005
I have a database of subcontractors I use for bidding purposes. My estimator would like to be able to view the list and select which subs he wants to use on a particular job and then print the list so I can contact them. How do I do this?
View 2 Replies
View Related
Oct 30, 2005
Hi
I have placed a Listbox in MS Access form. I use VBA. I have saved the item selected in the List box in a database. While retrieving the item from database, I want the listbox selected i.e the item should show as highlighted in the list box. Is this possible ?
View 3 Replies
View Related
Nov 8, 2006
I am experience brain flatulence and need some remedial assistance.
I am creating a data entry form. I have envisioned a tabbed format because I will have this idea utilized for Placement, Mentoring and Seminars data entry as well as recruitment. But I am open to other methods. Here is a description of what I have...
tblTeachers (this is the ONE)
Demographic data
tblRecruit (this is the MANY)
recLocation
recMethod
recYear
recSchool
Form
=================
List of teachers available to allow a user to see who has already been entered to prevent duplication
Use this same list for navigationrecord navigation
The problem I have is this:
I have created a tabbed control that has the data entry fields
I have created a subform to display ALL teachers from tblTeachers
I do not know/remember how to link these so that the list may be used to to display the select record in the tabbed control
View 1 Replies
View Related
Dec 11, 2013
I have a table containing a list of dates in "MMM YYYY" text format from "Jan 2010" to "Dec 2020".
I would like to restrict the list from the first record (Jan 2010) to the current month using today's date (eg in this case Dec 2013).
I know about
Code:
Format(Date(),"mmm yyyy")
And have tried the criteria
Code:
<Format(Date(),"mmm yyyy")
But doesn't work and haven't got much further....
View 6 Replies
View Related
Dec 29, 2013
I am trying to use a list-control on a form to let the user select multiple values. I have understood that this requires some VBA-code to step through the selections in the list, since the "multivalue-selection" is set to "Extended".
When I try to execute the code I have (found and have tried to adjust), then I get the error message "Object required". The "ListCount"-paramater always only results in a ZERO-value, when i step through the code:
Function cmdOpenQuery_Click()
On Error GoTo Err_cmdOpenQuery_Click
Dim MyDB As DAO.Database
Dim qdef As DAO.QueryDef
Dim i As Integer
Dim strSQL As String
[code]....
View 9 Replies
View Related
Feb 1, 2013
So I have a multiselect listbox. The list that it shows depends on what is selected in a separate combo box.I want to be able to select multiple items from the listbox, and then be able to leave the record, and when I come back to it, to still have those items highlighted. Right now in my form, as I go through records, if I highlighted items 1,2 and 3 on a record, those first three lines will stay highlighted as I move through different records, rather than changing to what had been selected for each record.
I've already stored the actual selected values in a subtable. I just want to have it highlighted again so that you can see what was previously selected.
View 2 Replies
View Related
Feb 12, 2014
I have two tables, TBL_Students and TBL_Email. Each of these tables have a field called Category, which allows multiple values from a list.
Is there a way to return records from TBL_Students where at least one value in TBL_Students!Category = at least one value in TBL_Email!Category.
E.g. If Student A has categories Maths, Physics and Computing;Student B has categories Maths, English and History;Student C has categories Physics and Geography
I would expect:
when TBL_Email!Category = Maths,Physics : Students A,B,C to be returned
when TBL_Email!Category = Maths : Students A,B to be returned
when TBL_Email!Category = Physics,Geography : Students A,C to be returned
View 2 Replies
View Related
Sep 17, 2015
In short, I want to know which records fail to append based on violating the primary key. (Win 7, Access 2010 32bit) Similar to how Access creates import table errors, but for append violations...
The DB takes a daily data dump. Failures to append (in this DB) indicate a status of "complete" that needs to be re-examined. (A true complete will not be present in the daily file). The daily file also contains all new daily work, thus it isn't just a list of "completed" tasks to re-examine.
View 3 Replies
View Related
Jul 28, 2015
I have a query which looks at a linked table (ODBC to SQL Server) in order to return a list of sub-accounts associated with an account. If I run it as a pass-through query it executes correctly, returning a list of the sub-accounts. If I run it as a query in Access it return the correct number of records but each sub account has the same name as the main account, as follows.
Result of pass through:
Main Sub
A X
A Y
A Z
Same SQL in Access:
Main Sub
A A
A A
A A
View 1 Replies
View Related
Sep 2, 2013
I'm trying to return a list of students in a particular team who have not attended a certain number of sessions at a gym, between two dates. For some reason i get the error. At most one record can be returned by this subquery. (Error 3354).
SELECT [Student ID], Count(*) AS ["Number of Times Attended"]
FROM Gym_Attendance
WHERE [Gym Date] BETWEEN [Forms]![SV_Attendance]![txtStart].Value AND [Forms]![SV_Attendance]![txtEnd].Value
AND [Student ID] Like
(SELECT [Student ID]
FROM Student_Sports
WHERE [Sporting Team] = [Forms]![SV_Attendance]![lstTeam].Value)
GROUP BY [Student ID]
HAVING Count(*) < [Forms]![SV_Attendance]![txtNo].Value;
View 1 Replies
View Related
May 20, 2014
In a query I'm trying to return a list of rows sorted by Service Type Ascending and then the last item in the list should be a row called "Add Edit Value".If I 'ORDER BY 2' then the "Add/Edit" row appears at the top which is not what i want.
My SQL:
SELECT '' As ServiceTypeID, 'ADD/EDIT VALUES' As ServiceType FROM ServiceTypes UNION SELECT ServiceTypes.ServiceTypeID, ServiceTypes.ServiceType FROM ServiceTypes
ORDER BY 1 DESC;
View 5 Replies
View Related
Sep 16, 2011
I created a search form that searches for Customer Number, Part Number, and Revision Number. The results are displayed in a List Box.
I want the user to be able to make a selection on the List Box and click an "Open Selected" button that launches that record in another form. How is this possible?
View 9 Replies
View Related
Feb 3, 2014
In Access 2013, I would like to be able to choose more than one value from a combo box, but I believe this is not possible. However, I can prepare a list box and set the Multi Select to Extended. Doing this, I can indeed select more than one value, but I don't know how to get those values into a text field in the form. (If poss, they would become comma separated in that field). Ideally, the code would call the list box because it would take up too much space if it were there all of the time.
View 2 Replies
View Related
Jun 24, 2013
I have a form to modify existing property records. Each record has a PIN number and a unique ID which is a combination of year, state county and PIN. The same property can have a record for more than one year. On this form I have a combo box for selecting the record to be modified. The combo box includes PIN and Prop ID. The combo displays each record by PIN then ID as separate records. For example:
PIN Prop ID
06104409012 2007-IL-Lake-06104409012
06104409012 2010-IL-Lake-06104409012
But when I select a record it will always select the first record with identical PINs. In the case above if I click the 2010 ID the record fills in with the 2007 ID.
View 3 Replies
View Related
Sep 16, 2014
I have a simple UDF that takes a string and returns a variant, which is an array of strings Example Input "Brick Wall" Return value would be a variant array with first element "Brick" and and second element "Wall" Now I have a table with a field of strings, and I want to make a query that returns all the results from the function, one per line.
So if my input table looks like this
[strField]
"kick the ball"
"return the pass"
my query result should looks like this
[Orig] [new]
"kick the ball" "kick"
"kick the ball" "the"
"kick the ball" "ball"
"return the pass" "return"
"return the pass" "the"
"return the pass" "pass"
Last time I had to do something like this I used VBA exclusively, with ADO objects, but I thought a query based solution would be easier.
With my current data the largest return array size my function returns is 27 elements but I wouldn't want to rely on that number being fixed.
View 3 Replies
View Related
May 1, 2013
i have created tables as provinces, districts and sub-districts in my other forms say member i have create a look up wizard to the provinces, districts and sub districts. every province has multiple cities and every districts has multiple sub-districts my question is how to set properties so that if i select a specific province all its districts should appear in district field and districts of other provinces should be filtered. a good example is on some websites when we select a specific country all its cities or states appear in city field and if we change our option to some other country city drop box also changes to the cities of that respective country...
View 2 Replies
View Related
May 25, 2013
I have a Parameter form which provides various parameters to my queries. The Parameter Form has a Combo box with a list of 50 health facilities which the user can select according to their needs.
There are instances when a user needs data from just one health facility and at times the data is needed for all the 50 health facilities in the district.
How do i address both needs without having to keep adding and deleting the criteria in the underlying queries?
I have added the 'if' condition below in the queries criteria so that if the user does not enter a facility in the combo box, it runs all facilities and if they enter a facility name then the data in the reports is limited to that health facility.
IIf(IsNull([Forms]![Parameter Form]![Combo27]),"",[Forms]![Parameter Form]![Combo27])
It does not work.
Is the expression or VBA code supposed to be entered in the Query or in the Parameter form and how do I make it work?
View 7 Replies
View Related