Selecting Item From Combo Box
Jun 5, 2005
Not sure what to search for so I thought Id write a new post:
I have a combo box which selects 3 items-
Primary key, Surname, Firstname
After an item is selected, the fields are populated according to the item.
Since there will be many records, it would be nice if the user can begin typing the surname and have predictive text, so the three items should then be-
Surname, Firstname, Primary key
So my question is, how do I get at the primary key if it is not selected?
myText = dlookup("myValue", "myTable", "primarykey = '" & ???? & "'")
If this does not make sense, what I am trying to say is:
The surname is selected, but I want to do a calculation based on the primary key so I get all the data associated with that user. I cant use the surname because there are duplicates.
Thank you
View Replies
ADVERTISEMENT
Jul 2, 2012
I have made a Cascading Combo Boxes form . This form has 3 combo boxes. Its working perfectly
I have to select items in all 3 combo boxes to get a report.
What i want is, if I do not select (leave empty) any item in the third combo box it should give me the report for all the items in the third combo box "Me.SubDesCbo"
How can I do that. I am using the following code:
Private Sub cmdOpenReportSingle_Click()
On Error GoTo Err_Handler
Const REPORTNAME = "Yarn Report"
Const MESSAGETEXT = "All Combo's Must Be Selected."
Dim strCriteria As String
' build string expression to filter report
' to selected customer and account
[Code] .....
View 1 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
Oct 31, 2014
I have a query pulling data from two other queries (qry_Reports and qry_Surveys). Clients may have more than one ReportID, but only one ClientID. I need to query for only the most current ReportID (which is the larger value) for each client to find the surveys for the most recent report. How can I query for only the most recent report for each client based on the highest value of the ReportID per ClientID?
View 11 Replies
View Related
Aug 29, 2013
how to stop user from leaving field without selecting item or entering data
View 2 Replies
View Related
Sep 9, 2005
When a user enters an item manually into a Combo Box MS Access Help shows how to add it to the 'Value' list. I need the code to add it as a record to the underlying table.
Note: The table has only one column.
Thanks
View 2 Replies
View Related
Feb 23, 2006
hi ,
i have a fro example menu and price database
that i entered Menu items and price of each other in it
and i linked this database to a order form that when i select for example capuchino it will give me 1 $ on price field
but the problem is here that when i whant to change the prices all of the past entered orders with last price will change to new one
how can i fix it ?
thanks
View 5 Replies
View Related
Jun 22, 2006
Hi everyone,
I have a form with a field named TREATMENT with the following options :-
1 Cryotherapy
2 Radiotherapy
3 Chemotherapy
4 None
5 Other (specify)
If the 5th option (Other) is selected, the user is required to specify what 'Other' represents.
I have created a combo box with the first 4 options and in instances of 'Other' the user can enter specific treatment that is not in the list (1 to 4).
What I would like to do is whenever the user enters a value that is not on the list (1 to 4), I would like to insert the word OTHER in front of the value entered. In other words all values not on the list will be prefixed by 'OTHER'.
E.G. if 'Surgery' is entered, I would like the value 'OTHER : Surgery' to be stored in the Treatment field of the table.
This will help in the generation of statistics from the table.
Any suggestions??
Many thanks in advance.
Will
View 3 Replies
View Related
Oct 24, 2006
Have a subform:
Name: frmProjectSub1
Default View: Continuous Forms
A combo box within the subform:
Name: cboProjectName
Control Source: Nothing
Row Source Type: Table/Query
Row Source: SELECT ProjectName FROM tblProjects WHERE tblProjects.Status LIKE "*" ORDER BY ProjectName;
Column Count: 1
Bound Column: 1
Visible: Yes
Enabled: Yes
Locked: No
Allow AutoCorrect: Yes
Tab Stop: Yes
OnClick Event:
Private Sub cboProjectName_Click()
With Me.frmProjectSub1.Form
Me.RecordsetClone.FindFirst "[ProjectName] = " & Me.cboProjectName
If Me.RecordsetClone.NoMatch Then
MsgBox "Can't find task " & Me.cboProjectName
Else
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
End With
End Sub
Within the continous form, if I name the Control Source as ProjectName, and traverse through the records, the value in the combo box changes to the current selected row.
Problem: In the combo box, I do get the dropdown list of projects, when I click on a project - Nothing Happens! The listbox stays open on the item that I clicked on -- does not close-up and put the selected item in the combobox window. I'm stumped...
View 3 Replies
View Related
Apr 1, 2012
I've created a simple form with a combo box, using wizard, and I create this code. for to add items when isnotinlist event. After requery, old data are changed to primary id numbers.
E.g.
Nametxt, id=1
Surnamext, id=2
Agetxt id =3
When i add a new item, the first item nametxt, converts to 1. This is the id. Here is the code
Dim cnn1 As ADODB.Connection
Set cnn1 = CurrentProject.Connection
Dim rs As New ADODB.Recordset
rs.ActiveConnection = cnn1
rs.Open " SELECT * from affectiontbl ", cnn1, adOpenDynamic, adLockPessimistic
[Code] ....
View 12 Replies
View Related
May 13, 2005
hi All..
I could set the Combobox.Value to one of the values in the combo box and combo box displays that value. But when I try to use Combobox.Value subsequently it does not have any value. I noticed that the value property is populated only when the combox box item is manually selected(highlighted).
How can I highlight the selection in a combo box?
Thanks in advance
View 1 Replies
View Related
Aug 12, 2005
Which event to allow to select the item from the Combo Box?
I try "click" and "change" events, but it do nothing?
Please help.
View 1 Replies
View Related
Aug 24, 2006
Hi,
I am using a combo box in my form. It is a growing combo box allowing new entries to be entered to create a growing list.
When new entries are made to the combo box list they are only displayed when I quit the form and then return to it. Is there any way I could allow the combo box list to grow dynamically rather than having to get the user to quit the form and then return to it?
Many Thanks
Turbojohn
View 6 Replies
View Related
Dec 12, 2006
Hello,
Didnt know where to start or what direction to head in. I have a combo box on one of my forms. It works fine, but would am looking for an added feature.
I am looking to get the following started:
There are 5 items in the list of my combo box. If the user selects the item called "Lost Opportunity", then how do I get an additional combo box to show up underneath it with reasons the sales opportunity was lost.
Then the reasons why would be in the additional box and they would have to select one...my work wants it so that if they lose the sale, they must provide a reason for that loss of business.
Any help in a direction would be appreciated.
Thanks.
View 4 Replies
View Related
Oct 20, 2004
I have made a few cascading combo-boxes that dynamically change based on the data entered into the field above them.. Example:
A SKU is entered, the combo-boxes pull the information for that sku from one or more tables (using SQL Query).
Now... I am having trouble getting these fields to show the first item in the list of possible item specifics. Everything comes in fine, however, I need to form to refresh and repopulate the fields one the SKU loses focus.
Any Ideas?
View 7 Replies
View Related
Jan 7, 2005
I have a combo box(drop down box), it uses a select statment to get data.
I want to assign each choices (item) from the combo box to a label's caption.
for exmaple the comobo box has these choices (item)
______________
|drop down box|
apples
pears
grapes
melons
I want to have 4 labels each label will have caption equal to each item in the drop down box so we now have
apples as label 1's caption
pears as labe' 2's caption
grapes as label 3's caption
melons as label 4's caption
how might I be able to do this in VBA?
IS there a way to select an item from a combo box and the set the label's caption equal to that?
Something like:
combobox.item1.value = string1
combobox.item2.value = string2
combobox.item3.value = string3
combobox.item4.value = string4
label1.caption = string1
label2.caption = string2
label3.caption = string3
label4.caption = string4
thanks for any help you might be able to offer
View 10 Replies
View Related
Jun 5, 2014
I have a combo box that won't allow me to select an item. The box is on a subform. When viewing only the subform, it works. When viewing the subform from the main form, it won't work.
View 8 Replies
View Related
Nov 8, 2006
I have a quick question on Forms. I have a combo-box in a Form that displays the student ID, first name, last name, and test scores from a source table. I have selected only specific fields to display from the source table in the combo-box. The intention is to note down the ID of a student for future querying purpose and I’m looking at easier ways to do it.
The question I have is, as I look down the drop-down and select a student by his last name (say Johnson), I want the student ID to be selected (or copied) when I click the specific student. There could be many students with same last name, and once I select a particular student from the drop-down, I was wondering if there was a way for this ID to be copied or selected. At present, the student ID is written down and used later for querying other information.
Thanks in advance.
View 1 Replies
View Related
Jun 5, 2005
:confused:
I have a frmServiceOrder form that has a "datasheet type" sfrmSOItem subform with a combo box that allows a user to select service order items...
Problem:
When I select a service order item in the dropdown, it doesnt place the item in the record...I have to select it a 2nd time in order to make it appear in the record. However, if I select the item by typing (i.e., via autofill) and hit the enter key, the item will populate in the record the 1st time.
I suspect it has something to do with my query joins. I hav played with various combinations and cant find a solution...
Any clues?
Thank you.
View 1 Replies
View Related
Nov 12, 2004
I am trying to select the records I want displayed by what category is chosen in the combo box.
Say there are two fields in the combo box: Red / Blue
I want the query to only display the records associated with the Red Category.
If I set the criteria in the query to [Show only Red] and type in Red when the query is run I get blank lines.
Is there an issue when choosing a category from a combo box for the query to be specific on?
My other issue is.... does the problem originate because I am trying to run a query from a table that is being filled in by typing the
information into a form? I wouldn't think so, but I am not sure.
Thanks,
ChrisB37
View 5 Replies
View Related
Sep 1, 2013
Is it possible to remove an list item from a combo box list after it has been used.
What I am trying to do is use a combo box that has a list of questions, after the user selects a question from the combo box list and answers the question when they reselect the combo box that question will not be seen again till the form is reloaded.
View 2 Replies
View Related
Feb 2, 2015
So I have this form with a combo box which successfully displays a range of items from which I would like to select from - but unfortunately I cannot. I cannot select anything from the combo box.
I have checked the form and table to ensure I have edit rights - which I do.
The form is based on a query - attached is a picture of the relationships within the query.
I assume I have created a non updateable query but this is only an assumption.
I am lost about the best course of action to take. Is there a way to identify the problem?
Do I just cut my loses and recreate the functionality somehow?
View 5 Replies
View Related
Feb 16, 2005
Hi,
ok part of my database is made of 2 tables.
tblItems
item_id
maunfacturer_id
supplier_id
item_name
tblQuantities
quantity_id_num
item_id
quantity
(item_id linked)
ok so I want a form that has a combo box with [item_id, item_name] on each row that i select. when i select one it displays the relevant quantity and allows me to edit the quantity.
any ideas how i can do this?
Thanks:)
View 3 Replies
View Related
Jul 7, 2006
Hi,
I was wondering if it was possible to use a combobox where you could select a month and year (eg March 2004, April 2004) so I could run a query to find orders made during the chosen time period.
Does anyone have any ideas how this could be done?
Cheers,
Ben
View 1 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 20, 2013
I have a form with a combobox whose list items are taken from a table of currencies (called tblCurrencies)
Row Source = SELECT [tblCurrencies].[Ccy] FROM tblCurrencies ORDER BY [Ccy];
Problem is, there may come a time when the currency they want to select is not yet part of the tblCurrencies table, and needs to be added. For simplicity, I'd like to have an additional option in the dropdown (perhaps at the bottom) to specify a new currency.So an additional list item (e.g. 'Add New...') which when selected could prompt a subform where the user could specify the new currency (and any other relevant details specific to that currency) which can be programmatically added to tblCurrencies.how do I get that extra option into the list items for the combobox?...
View 2 Replies
View Related