I have a form which displays records of our products, on that form I have now put a list box which displays the ancillaries to the products.
both the form and the list box run off queries.
I have the same unique identifiers in both queries.
I need to filter the listbox by the unique identifier every time I move record.
At the moment the list box stays populated with all the ancillaries, how do I filter it programatically to list only the ancillaries with the same unique identifiers as in the current record?
I use the follwing code to filter a report based on the listbox selection on a form. Below is the code I use, the problem it will error if the results have an apostrophe in the string.
Private Sub FilterDesc_Click() Dim strWhere As String Dim ctl As Control Dim varItem As Variant 'make sure a selection has been made If Me.ListCarrier.ItemsSelected.Count = 0 Then MsgBox "Must select at least 1 Carrier"
I have managed to link a report to a form where you can double click on the surname and the report opens automatically BUT I want the report to only show the data from the record that I have double clicked - at teh moment the report is coming up with thousands of pages - one for each record.
Can anyone help me with this - I think it's probably something simple but I can't work it out on my own :eek:
I have a database For customers of the company, when you open the main form through the search form , there are a filter . when you try to move between orders of this customer, there are a mssage (Asking you to approve of movement between the customer orders). to this point no problem, when you approval to move , cancel the filter on the main form with a stay at the current record (current customer).
I need a way to dynamically store a particular value in "field_2" of the CURRENT record depending on whether or not the value of "field_1" of the CURRENT record is identical to the value of "field_1" of the PREVIOUS record within the same table. The table is sorted on "field_1".
So, if the value of "field_1" in the CURRENT record is "ABC" and the value of "field_1" in the PREVIOUS record is also "ABC", then store a value of "PPP" in "field_2" of the current record. IF on the other hand, the value of "field_1" in the CURRENT record is "ABC" and the value of "field_1" in the PREVIOUS record is "XYZ", then store a value of "WWW" in "field_2" of the current record.
I have a report that will use these results to count only the number of records that have a "WWW" in "field_2".
Is this doable, maybe in a query somehow?
I should add that whatever the solution, it needs to be compatible with Access 2000.
I am designing a contact management system and have hit a bit of a wall. I am farily new to Access so please advise if I am going about this the totally wrong way.
I have three tables; Contacts, Companies, Company_Addresses
Contacts: ContactID (P) CompanyID OfficeName
Companies: CompanyID (P)
Company_Addresses: CompanyID OfficeName (P)
What I want is when adding a contact, to have a drop down list in the CompanyID field showing all the companies in the Companies table, and then in the OfficeName field, have a list of only the offices related to the company selected in the previous field.
I can do the first list, but cant work out how to list only data related to the company selected in the previous field. Any help would be greatly appreciated.
I am designing a contact management system and have hit a bit of a wall. I am farily new to Access so please advise if I am going about this the totally wrong way.
I have three tables; Contacts, Companies, Company_Addresses
Contacts: ContactID (P) CompanyID OfficeName
Companies: CompanyID (P)
Company_Addresses: CompanyID OfficeName (P)
What I want is when adding a contact, to have a drop down list in the CompanyID field showing all the companies in the Companies table, and then in the OfficeName field, have a list of only the offices related to the company selected in the previous field.
I can do the first list, but cant work out how to list only data related to the company selected in the previous field. Any help would be greatly appreciated.
right, struggling here. Basically I have continuous form listing all the standard letters sent out when I double click on a letter, I need to to run a query for me. The code I have put behind the button is: If ([StandardLetterType] = "Homework") Then DoCmd.OpenQuery ("qryHomeworkClearMailMerge") DoCmd.OpenQuery ("MergeHomework"), , , , , acDialog, Me.[StandardLetterID] DoCmd.OpenReport ("rptHomework"), acViewPreview Else ' end if
and in the query I am first clearing the mailmerge yes/no field out which works fine and then running the merge to put the yes back in the current record so the query looks like this
Its an update query with update to yes for mailmerge and under the standard letter ID i have the criteria [Me].[OpenArgs]
is this completely wrong tried the [Forms!][frmFullStudentReport].[standardletterID] but it kept popping the box up asking for the number.
On the form I have the standardletterID and its hidden but there.
Having a problem with a report, I have a form that i use to enter a new record to my database, what I want to do is put a button at the bottom of the form to print the record (via a report)
If I base this on a record that already exists, it works fine. However, If I have just entered the record the query the report runs off doesn't see the new record. To print that record I have to exit the completed record, then go back in to it and print. My aim is to remove this additional part of the process, I'm sure it's something really simple, but can anyone help?
I need to Print a single record from a form but using a report layout.
I have created the form and created a report. A button on the Form kciks off the print but I get all records rather than just the one shown on the Form. Whats a really simple way of just selecting the Current record.
Where do I put an instruction saying print only this record:confused:
btw, although values will always be in order they may not all be output, so it's not just case of odd, even, odd, even (that would be too easy!)
I can retrieve the Previous Record's GroupNo value (via a function) in another text box and compare current GroupNoID with this in the Format Expressions and manage to change the colour, but it won't sustain this new colour for the subsequent same GroupNos, obviously as the values have changed.
So how can I....
Change the colour when the value changes. Keep this new colour until it the value changes (increases) again.
I am working on converting someones Paradox Database to Access and making some modifications.
I have a table with people in it and they are linked to a number of interests. But i am struggling to create a query so that on each page of the form for the person i can call the interests and display them on the form as a list...
If anyone could point me in the right direction that woul dbe appreciated!
Give me mysql and a bit of php anyday!! hehe
I am using Access 2007 but i have used access before so i should be able to work my way through instructions for 2003.
I currently have a form that only shows data based on a specific record id. I have placed a list into that form though that has multiple record ID's listed ( It's a log). How do I get a List to Filter to just the Record ID that corresponds to the current form Record.
What I have are as follows:
A form that has client information : Address, phone numbers, Etc.
On that form I have Pages. one of the pages contains a List.
That List however contains information from multiple clients based on Point of Contact ( Call Log)
What I want is a way to narrow the List to only show those that corresponds to the Current Client Record.
Is this possible? If my approach is wrong, which is a better way?
I'm using a sub form to display data form a table. The users wanted it display like a spread sheet. In order to get all the data to display on the same page I am trying to break some of the longer feilds out (i.e. comment field) and display them in a list/text box and not in the table with the smaller fields.
Basically what will happen is when a record is selected in the sub form the comment field tied to each record will be displayed below. I've tried a few things but I keep getting errors displayed in my list/text box (#Name?)
I'm trying to hash two scripts I've found into 1 functioning filter, however I'm still relatively new to vba and can't figure out how to get this working.
I'm trying to use Allen Browne's Search Criteria:
with another snippete of code I found here:
Code: 'Purpose: This module illustrates how to create a search form, _ where the user can enter as many or few criteria as they wish, _ and results are shown one per line.
[Code]....
It's the date part I'm having trouble with, the rest of the search criteria work fine without the date, but I can't get it working when I try to modify and merge the date sections of each code.
Also I'm using a listbox for the "Yesterday";"Last 4 days";"Last 9 days" and not a combo box.
My form has a listbox (lstHeatTreatments - Multi-Select disabled) that displays Heat Treatment descriptions and an unbound textbox (txtHTDetails) that I would like to have display the corresponding memo field when a description is selected from the listbox.
This is my code so far:
Code: Private Sub lstHeatTreatments_AfterUpdate() Dim myConnection As ADODB.Connection Dim myRecordSet As New ADODB.Recordset Dim mySQL As String Dim selectedRequirementKey As Long Set myConnection = CurrentProject.AccessConnection Set myRecordSet.ActiveConnection = myConnection
I have a list box called "product list box" based on a query called "searchqry", i also have another listbox called "type list box" , how do i get the type list box to only show "types" based on the section in products list box?
Im trying to set up a button on that form that will look at a current file lets say sex: male and it will filter all of the records by that criteria. Can someone point me in the right direction. Any help would be appreciated!
I have a table with training records. Each attendee is listed with date and the related document he was trained on. Now i want to make a listbox where the user can choose between the different dates of the trainings. Now when several people where trained on the same day, i get some dates back multiple times in my listbox. When you had 100 on the same day, 100 times the date in that listbox. Is there a way to filter out the same dates and show each date only one single time in my listbox?
I have List box called 'lstNote' base on a query 'qryNotes' with filter tied to textbox 'filter' on my main form 'frmNotes'. The filter specifies criteria for field called 'ntype' on 'qryNotes'.
I have buttons that change the filter field to specific criteria. The listbox works fine this way for filtered records.
I want to also be able to not have any filter for the 'lstNote' so that all records for 'qryNotes' are listed without criteria.
I tried, but was not successful, to set the filter criteria to a wildcard or no filter with
IIf(IsNull(Forms!frmNotes!filter),(qryNotes.nType = Like *),Forms!frmNotes!filter)
But this produces no records at all.
Any suggestions? Do I need to go down another road?
Basically I want to listbox to either show any of the filters and also all records.
I have a form called “frm_TrainingLog” based on “TrainingLog” table. This form is continuous and tabular – I need to have it this way. In the header of this form I’ve created a listbox called “QuickSearch” which displays staff details i.e. StaffID, Name etc.
The mainform and the listbox are linked using the following code:
The above code does partially work and selects the right record in the mainform but it doesn’t filter out rest of the records which are not equivalent to selected StaffID from the listbox.
This im sure is a easy question but I am just trying to learn access so I am having a few problems.
I have made a form that contains 2 comboboxs and a listbox.
How can I use the 2 combobox to filter a table and to place the information into the listbox. Is it possible to use either 1 of the combo boxes or both to get the filtered result.
Now I have coded what I think should work for my listboxes and it does not. When I click it does nothing. No processing of anything.
I have 11 multi-listboxes and want to collect what the user selects from each one and then use it to run my query. The query only uses 4 of the listbox items and then 4 other items that I have in the query. I want to be able to display this in the same form or perhaps a subform. Here is my code:
Code: Private Sub command8_click() ' Update the record source If BuildFilter = "" Then Me.frmQual_Sub.Form.RecordSource = "select * from qualq1 where " & BuildFilter End If
I wish to filter the records in a listbox by using checkboxes.
The listbox (list1) and the checkboxes are in the same form (form1)
The listbox displays the records from a query (query1) related to a single table (table1).
Each record (assuming a list of videos) has a field called "Typology". The "video typologies" are: Movie, Documentary, Animation. So the table1 has a column called "Typology" which displays one of the three typology in simple text.
When entering a new record (in a specific form) user can choose the typology selecting an option in a combobox. The combobox is a "value list" one and I wrote the typologies in the "row origin" line: "Movie";"Documentary";"Animation"
So we have a single column in simple text for all the typologies, but limited choiches.
So far everything is working well.
Now I wish to filter the records in the listbox by typology. Each typology should be related to a checkbox, so when I check a checkbox then the listbox returns only the records form a specific typology. Also, I wish to check more then one checkbox in order to display records from multiple typologies rather than one.
I've already made a button which resets the form, displaying once again all the records and eventually unchecking all the checkboxes.
About option buttons: I've managed filtering the listbox results using option buttons in a frame (option group?) and it works fine, but in this way I can choose only one typology at a time (and the typology field in the tabel1 of course is not simple text, but numeric: 1=Movie, 2=Documentary etc).
I thought this could be solved using the click event on each checkbox:
-If the checkbox "Movie" is checked then the listbox shows only the records which have the text "Movie" in the Typology field. Else, show all the records. -If the checkbox "Documentary" is checked then the listbox shows only the records which have the text "Documentary" in the Typology field. Etc......