Combo Box Populates All Form Records

Nov 24, 2006

Hi everyone,

I have a form with a combo box, whose afterupdate code is:

Private Sub CustomerName_AfterUpdate()

Dim rs As Recordset
Dim person As String
{This will contain the SQL Statement}
person = "select people.department from people where people.name='" & CustomerName.Value & "'"
Set rs = CurrentDb.OpenRecordset(person)
{Now the following are combo/text boxes that are populated}
Department.Value = rs("department")
InputDate = Date
InputTime = Time

My code works: when you select something in CustomerName combo box, the other boxes in the record get populated with data. The problem is that ALL the records in the form get populated with this data as well...
I want the records to be independent of each other - that each record will be filled separately.

Any ideas?

Thanks,

Gilad.

View Replies


ADVERTISEMENT

Combo Box Populates All Form Records

Nov 24, 2006

Hi everyone,

I have a form with a combo box, whose afterupdate code is:

Private Sub CustomerName_AfterUpdate()

Dim rs As Recordset
Dim person As String
{This will contain the SQL Statement}
person = "select people.department from people where people.name='" &

CustomerName.Value & "'"
Set rs = CurrentDb.OpenRecordset(person)
{Now the following are combo/text boxes that are populated}
Department.Value = rs("department")
InputDate = Date
InputTime = Time

My code works: when you select something in CustomerName combo box, the other

boxes in the record get populated with data. The problem is that ALL the records in the

form get populated with this data as well...
I want the records to be independent of each other - that each record will be filled

separately.

Any ideas?

Thanks,

Gilad.

View 1 Replies View Related

Forms :: Combo Box Populates Every Field On A Form

May 5, 2013

When I enter a combo box on a form, whatever I choose from the combo box, it populates everything. If I go to a different row to change it, it changes them all. How do I get that to stop? And why does it do that?

View 6 Replies View Related

Value In Text Box As Criteria For Query Which Populates Combo Box

Oct 25, 2006

Simple question but I've been stuck for a looong time.

So what I want to do:

1. enter a value into a text box (Home_Tel) in a form (frmStudentClass)
2. which runs a query (qryNameTel)
3. and return the results to a combo box (Student_Name) on the same form.

The same Home_Tel may have several Student_Name results.


-I have entered
[Forms]![frmStudentClass]![Home Tel]
for the criteria in the query
- However I can't get the results to turn up on the combo box
- I have the following:

Private Sub Home_Tel_AfterUpdate()
' run query
DoCmd.OpenQuery "qryNameTel"

Me.Student_Name.Requery

End Sub



Any ideas?


Or is there an easier way to tackle the problem?


Home_Tel and Student_Name are from the same tables.
I have created a query just for Home_Tel and Student_Name



Thanks everyone!

View 1 Replies View Related

MainForm ComboBox Populates All Records In Query... Why???

Mar 15, 2005

All:

Currently have a Form / SubForm arrangement combining qryItemAllowedAndUnschedlued with tblInventoryItem.

The main form is based on the query and the subform on the table.

My effort is to create cascading combo boxes where a selection in the main form populates a "conditional" list in the subform.

More specifically, where the user selects ItemClass in the main form, I am attempting to populate a list of ItemCategories in the subform based on the selected ItemClass.

I have reviewed and continue to study existing posts on Cascading Combo Boxes and Form / Subform arrangements. However I currently have a question I do not see covered...

When I select my ItemClass it is populating throughout the query and not solely in the current record displayed.

Does anyone know why this may be?

I fear the answer is a simple setting that my current experience is making difficult to isolate. I trust it will present itself with patience, but in the interim more experienced feedback is welcome!

Regards

View 1 Replies View Related

Form Populates Two Rows In Table

Mar 13, 2008

Anyone know why the following would happen:

I have a form that is linked to a single table. For some reason some controls populate one line in the form and others populate another line.

Each time I complete the form it creats two records with some data in one row and other data in another row.

View 1 Replies View Related

Problems Using A Combo Box To Filter Records In Another Combo Or A Sub-form

Nov 8, 2004

I have seen a few articles here and there on using a combo box to filter records in a sub-form and to filter records in another combo box, but I am not getting anywhere. I hope someone can belp

Exercise 1

For this exercise, I have the following tables:

tblClients containing client names
tblProjects containing some project details

I want to set up a simple form, so that the user can select a client name from a combo box on the main form which filters the project detail records in the Projects sub-form.
Once the user enters project details, I want this info as well as the selected ClientID to be fed back to tblProjects.


Exercise 2

I have the following tables:

tblProjects as above
tblWorkstream containiig names of workstreams and some other details.

Every project has one or more workstreams

I have a form where users will enter hours worked on each workstream. They will first select Project from a combo box on the main form. This should then filter records to be displayed in the Workstream Combo box, before they can then enter hours.



Please let me know if you need me to explain any part of this better.

Thanks in advance.

ps. I am a novice, so I'm hoping to do the above using default MS stuff, not with complex programming!!!

Thanks

View 14 Replies View Related

Forms :: Form Auto-populates Date Field - Want To Add Check Box To Enter Alternate DATE

Nov 1, 2013

We use access to enter our service tickets in at work.What we have are three date fields.

Call Date
Start Date
End Date

We are 24/7 operation.Currently all 3 just autopopulate with the current date.What i would like to do is ADD a CHECKBOX next to each Date Field.And make it work like this.

1. let them autopopulate as they are currently
2. if you end the call AFTER MIDNIGHT (the next day). CHECKING the box would automatically populate yesterdays date in each of the fields that has the check box CHECKED

View 3 Replies View Related

Deleting Records From A Form Using Combo Box

Mar 11, 2008

What code do I need to delete a record using a form and a combo box. I need to be able to link the selection in the combo box to a button that, when pressed, will delete the selected record.

Information:

Account Executive Combo Box - select an account executive based on a table (that contains only account executives and an autonumber)

Table name: AccountExecutives
Form name: DeleteAccountExecutive
Combo Box name: Combo300
Button name: DeleteExecutive

View 1 Replies View Related

Combo Box Blank When No Records On Form

Dec 30, 2005

Hello,

I have an unbound combo box in the header of a continuous form. The box is set to value list, and when you select a value, the recordsource of the form is changed. This works fine.

However, if I there are no records in the underlying form, the combo box is blank. If I check the value in the immediate window or the after update, I can see that it is set properly and contains a value, it just doesn't display it. I am using Access 2000. I have tested on Access 2003 and cannot replicate the problem.

I have found one post here (http://www.access-programmers.co.uk/forums/showthread.php?t=84423&highlight=combo+box+blank) on the topic.

I found this (http://support.microsoft.com/default.aspx?scid=kb;en-us;287478) article on Microsoft which has my symptoms, but I am not opening a recordset.

Anyone know how to fix this??

View 5 Replies View Related

Search For Records In A Form Via Combo Box

May 30, 2006

Dear all,

I'm trying to incorporate a combo box in my form to navigate through records. The plan is to select a piece of equipment listed in the combobox, and that record will then be displayed as an "after update" action.

However, I have tried through coding I have tried before and utilising the wizard to create this combo-box, but each time I get a "Complie Error - Can't find project or library".

The section of code is shown below:

Private Sub Combo227_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[EquipmentID] = " & Str(Nz(Me![Combo227], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Any help gratefully received!

Thanks,

Steve

View 2 Replies View Related

Show Filtered Form Records In A Combo Box

Oct 17, 2006

This sounds like a cascading combo box issue but it isn't quite.

I filter my form using 2 unbound combo boxes which can be used in any order, both of which define text strings using case select. These strings are concatenated into a filter text and applied by a routine called in the after update event of either combo. All works well.

My question: How can I show all the filtered records in a third combo box so that users can easily select the record of interest from the filtered set?

I attempted to define SQL for each combination of the 2 comboboxes but it was getting ludicrously complicated so that got the heave ho.

After that, I attempted to use a recordset clone, but I couldn't get this to work:
'Clone record set for combo box rowsource
Dim R As Recordset
Set R = Me.RecordsetClone
R.Bookmark = Me.Bookmark

'Populate combo box with recordset
With Me![cboProjectList]
.RowSource = R
.Requery
End With


Reading the Access help, it seems that a combo box can only be populted via query, table or SQL. Is there any way of using a cloned recordset or the me.filter to show the filtered form records in a combo or list box?

I will be very grateful for any pointers.

View 8 Replies View Related

Modules & VBA :: Using Combo Box To Filter Records From A Form?

Oct 1, 2014

I am using combo box to filter records from a form. The data source for the form is from a query.

I use the combo box within the query to filter the data, I would like the form to refresh/ run the query again every time a new selection is made from the combo box.

View 2 Replies View Related

Field Populates Depending On Cbo 1 And 2

Nov 25, 2005

I would like my form field to populate based on what the user selects from 2 combo boxes I have. I have a table set up with Region, Position, and Name. I would like when the user selects for example Eastern for the region and President for the position that John Smith would auto populate in the form field. Is this possible and if so, how can I get this to work?

View 1 Replies View Related

Field Auto Populates

Nov 23, 2005

What is the best way to get a field to automatically populate on a form when the user select criteria from 2 combo boxes. For example in cbo1 the user select Eastern and cbo2 the user selects Regional President. How can I get in a seperate field the name of the Eastern Regional President to populate?

View 10 Replies View Related

Combox Value Populates Subform

Nov 15, 2006

Hello,

I have a simple question with an answer that hides relentlessly from me. I have a combo box on the main form called cboProjects. I also have a subform called SubProjectsDetails. I'm trying to get it to where if a user selects a project from the combo box, the details show up in the subform. The relationships are good and working, and if I add a Find Record button on the form, that works as well. I just don't know the code to dynamically populate the subform with combo box values.

Anyone have any tips?

Thanks

View 2 Replies View Related

REFRESH Combo Boxes For Records On Continous Form

Jul 7, 2005

Background:
I have a continous form linked to a table and I have 3 combo boxes on the
form (linked to fields on the table). The combo boxes are called JOB TITLE,
SCHEDULE and SHIFT. The source for the combo boxes are queries named
respectively as LKUPJOB, LKUPSCHEDULE and LKUPSHIFT. For the three combo boxes listed abpve, the bound column is the first field of the underlying query and the column width of the first field is set to 0" (so that the second field of the query is displayed).

The way things should work is that for each record on the form, the
LKUPSCHEDULE and LKUPSHIFT queries (queries for the SCHEDULE and SHIFT combo boxes), the queries are filtered based on the bound field of the JOB TITLE combo box. The name of the bound field for the JOB TITLE combo is called Labor_Rate_ID.


Problem:
Unfortunately, It seems like the value of the labor-rate_ID in the first
record (i.e. first job title combo box) determines the query list used by the
SCHEDULE and SHIFT comboboxes for all the other records on the form. That is, even though the form has lots of records displayed, the combo boxes for each record don't have a complete list to work with.

Hence, the SCHEDULE and SHIFT combo boxes for some records are showing a blank (since available otions in the combo query list don't match the value
in the table for that record.

Can anybody tell me how to get a continous form to refress the list for each
record on the form.

I also don't know whether the Requery command for a macro could work and how to use it. I think though, that this problem can't be solved by a macro.

Basically, the question is around what kind of code will let you manipulate the properties of individual controls of a form at the Record level.

Pele

View 7 Replies View Related

Forms :: FindRecord Split Form Records From Combo Box

Dec 21, 2013

I have a split form with many of a combobox (date, text,numbers and both).

How can displayed only the records in the datasheet based on a combo box selection?

How to build this mechanism and write a sample code?

View 14 Replies View Related

Queries :: Filter Records In Combo Box By Form Using In Function

Jun 15, 2013

I want to filter the records in a combo box (cboSupplier) using the In() function.

On the form I have an unbound control called "intFilter". It contains the following string: 23, 58

The SQL statement for the combo box is

Code:
SELECT SupplierID, SupplierName
FROM tblSupplier
ORDER BY SupplierName;

In the criteria for field SupplierId I want to use the In() function so that the only records returned by the combo box are those in "intFilter". I have tried

Code:
In (Forms![frmSupplierReport]![intFilter]

but this does not work.

If I put: In (23, 58) in the criteria it works, but I cannot hard code it because the string in "intFilter" will change on the fly!

How would I achieve this?

View 4 Replies View Related

Multiple Combo Boxes In Form To Choose Groups Of Records

Feb 16, 2005

Hello,
I am wondering if it is possible to have several combo "boxes" in one form. The form is based on one table. In the table there are several fields which use a look-up (combo) drop down box to choose from: Type, Description, Manufacturer and Location.

In the form I want a combo box for Type, to bring up specific records in a subform, then I want a combo box for Description to bring up another set of records (within that Type of equipment) and a third combo box for Location to bring up all equipment within that location.

When I have tried to set this up - it changes some of the data in the in the subform - which changes it in the underlying table. If it set the form to open in New Record, then nothing shows up in the drop down box. Is there some If, THen code I could use to make it look first in the Type, then in the Description field, then close those out and look for the set of records that match in the location field?

Does that make sense?

I know how to manipulate in MSAccess templates, etc., but I don't know much about the underlying codes.

Thanks for any help!!!

View 1 Replies View Related

Textbox Populates Only After Tabbing Past

Sep 20, 2005

I have a combobox where users can select classes. In the AfterUpdate event for that combobox I have the following code:

Me.ClassCode = DLookup("[ClassCode]", "Classes", "[ClassID] = " & Me.ClassID.Column(0))

I want to populate the Class Code field based on the class they select. The code works fine except that the Class Code field does not update until after I tab past it. There is a field in between Classes and Class Code so I have to tab 3 times before the textbox populates. I expected the textbox to populate immediately after I selected the class. I also tried putting the code in the On Click event of the combobox but that didn't work either.

If I just keep clicking on different classes I'd like the class code to change each time without having to tab to another field. Is that possible? What am I doing wrong?

Rod

View 1 Replies View Related

Modules & VBA :: Value From Text Box Populates Other Textbox?

Aug 9, 2015

Code:

Me.PHOTO = " & Me.text36 & " & Me.FILENAME & "" & Me.FILENAME & ".jpg"

tell me what I have to change in the " & Me.text36 & " part so that the value displays the value in text 36 and not the words me.text36

View 1 Replies View Related

Getting Duplicate Records In Split Form Datasheet When Using Combo Box With Multiple Selections

Jan 30, 2015

How to correct the issue below. I created a split form and I have 2 combo boxes that allow multiple selections. The one combo box for LOB (line of business) works perfect and does not create duplicate records in the datasheet view of the split form. The 2nd combo box with multiple selections creates duplicate records in the datasheet depending on how many selections are made.

I have checked this in the underlying table and there are no duplicate records, it is only in the split form datasheet. I have checked settings and configuration between the 2 combo boxes that are reacting differently and they appear to be identical...

View 7 Replies View Related

Forms :: Show All Records In Datasheet Subform On Form With Combo Box Filters On Load

Apr 1, 2015

I am having an issue trying to show all records when I load my form. It loads correctly when I don't have a record source for the main form. However, the combobox filters will not work. My goal is to have users be able to use the datasheet, subdatasheet and combobox filters. I can get the form to work just fine when I link the Main form and subform, but when the form opens it is filtered on the first record. I have been successful with this approach when using other forms, but they didn't require a subdatasheet.

Is there anyway I can have the comboboxes to filter yet be able to show all records until the user selects filters? Is this possible?I finally got my Manager to agree to use a database instead of Excel files based on this form setup and I need to make as "user friendly" as possible (look and function like a spreadsheet) I attached some pics of the form along with the code for the filter.

View 1 Replies View Related

Modules & VBA :: Query To Compare Values To Show All Records Where Form Combo Value Is Selected

May 1, 2014

I am building a tracking database where we would be able to track information which field are null data and report them to our Administration to fill the null data. For this I have created a form name "Search" and I have a combo box control on that form which is bound to "Table = employee" and its ROW SOURCE TYPE="Field List", I would like to able to query records where the selected value in this combo box is null through out the table.

For example if I select "Telephone" from this combo box dropdown, I would like the query to show all the records where the "Telephone" is null, how to set the criteria in query to take the combo box value as "Field Name" and then compare it with the Field/Column in the table and show the null values.

View 4 Replies View Related

Queries :: Query That Populates A Report Linked To Mail Merge

Aug 30, 2013

I have a query that populates a report linked to a mail merge. There is an IFF statement in it that checks to see if a condition is meet. If that condition is meet some standard text results. Is it possible to put a disclaimer with the standard text.For example,

Code:
IIF ([Results]="Negative","Nothing detected" (the disclamer would go here)

I am not certain the correct syntax to use to insert "not all regions were tested".

View 1 Replies View Related







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