Question lookup field with table

snirben

Registered User.
Local time
Today, 10:26
Joined
Nov 26, 2016
Messages
33
Hi, i have a form with a subform and i would like to know how can i add a vaule to a field not with the normal lookup field or combo box or list box . i want to add a vuale from a table or from a list that i can filter.
how can i do it?
thanks for the help.
 
Hello and welcome,

What do you mean "add a value to a field?" Are you trying to add a row to a table? Maybe you are trying to set the value of a field? Or do you need help getting the value from a table or list?
It's not exactly clear to me where you are stuck.
 
I could probably describe how you could add a value to a field from a filtered table in a subform or perhapts a popup form but since I'd be replicating the functionality of a combo box or listbox I would like to know what it is about these that needs to be avoided. What's the problem with using a combo box or listbox?
 
I could probably describe how you could add a value to a field from a filtered table in a subform or perhapts a popup form but since I'd be replicating the functionality of a combo box or listbox I would like to know what it is about these that needs to be avoided. What's the problem with using a combo box or listbox?

Because I have list of 10000 items and combolist not helping me. I would like to know how to do from a popup table or a from like you said. Thank you.
 
how do you plan on filtering the list of 10,000 items?
it sounds like you would want cascading comboboxes to wittle it down to manageable number but that would depend on your table data.
 
how do you plan on filtering the list of 10,000 items?
it sounds like you would want cascading comboboxes to wittle it down to manageable number but that would depend on your table data.

all i want is:
i have a form with a field. i want to make a popup with the 10000 items table.
thay are devide by Group/type and more. i just want to pick 1 from the list after i filter or just search to add the name to the field.
 
Re: Hello and welcome,

What do you mean "add a value to a field?" Are you trying to add a row to a table? Maybe you are trying to set the value of a field? Or do you need help getting the value from a table or list?
It's not exactly clear to me where you are stuck.


i want that when i click on a field in my form it open a popup with my table of 10000 items. and i can choose one of them and it will enter the name field in the table to the field in the form
 
i want that when i click on a field in my form it open a popup with my table of 10000 items. and i can choose one of them and it will enter the name field in the table to the field in the form

then just set your original form control by setting it to the selected value.
Forms("Your original form name").YourControlName = YourSelectedValue

just search to add the name to the field.
Thats what a combobox will do.
 
Last edited:
then just set your original form control by setting it to the selected value.
Forms("Your original form name").YourControlName = YourSelectedValue

Thats what a combobox will do.

can you please be more detailed i am new to accsess xD
how i do that>? where i enter the code?

yes but i want to see all of the table and to filter stuff. combobox is just open me a list with no filter.
can i would like to do it popup. there is a way?

i add a file
i have subfrom with table and i want to do when i click on the first field it opens a popup with a table that i can filter and choose 1 item for every new field there.
 

Attachments

  • Captur2e.GIF
    Captur2e.GIF
    36.7 KB · Views: 94
Last edited:
sorry but your form in the picture you posted is foreign to me.(punn intended)

Are the names of the items unique? if so, as you type in a combobox it should filter down to the item you want.
 
sorry but your form in the picture you posted is foreign to me.(punn intended)

Are the names of the items unique? if so, as you type in a combobox it should filter down to the item you want.

let me try to explain again,
i have a form with a subfrom, in the subfrom i have a table with fields
in the first field i have "Name of the item" and i want when i click on the field it open me a popup with my items that i can filter and choose one and then the 1 i choose is insert to the field. like a combobox but with popup and options to filter.
 
I get what your trying to do however its difficult to advise you without knowing more about your tables, data forms,workflow,etc.

from the look of your form from the picture it looks like your subform is a datasheet or continuous form. if you are trying to click on a new (blank) record in your subform i don't believe there is anyway to pass the PK (as it doesn't exist yet) of that record to the pop up form, so there is no way to pass back the itemID to the subform.

Again i dont know the purpose of your form but for argument sake lets say its a order form and you want to add items to the order. so lets say you have a customer table with a PK and customer name. You also have an items table with a PK and item name. Then you also have a table of orders with a PK, a CustomerID and an ItemID.

So what you could do is open your Pop-Up form which has the list of all available items. You have an unbound textbox on the form, Call it oaCustomerID and set its recordsource to =OpenArgs. when you open the popup form you pass the customerID as an openArg such as
Code:
DoCmd.OpenForm "MyPopUpForm", , , , , , Me.CustomerID
Then when you select an item you do an insert into the table of orders using the customerID and ItemID from your popupform. when you close the popup form you requery your subform and the item(s) will be there.

heres an example
 
Last edited:
I get what your trying to do however its difficult to advise you without knowing more about your tables, data forms,workflow,etc.

from the look of your form from the picture it looks like your subform is a datasheet or continuous form. if you are trying to click on a new (blank) record in your subform i don't believe there is anyway to pass the PK (as it doesn't exist yet) of that record to the pop up form, so there is no way to pass back the itemID to the subform.

Again i dont know the purpose of your form but for argument sake lets say its a order form and you want to add items to the order. so lets say you have a customer table with a PK and customer name. You also have an items table with a PK and item name. Then you also have a table of orders with a PK, a CustomerID and an ItemID.

So what you could do is open your Pop-Up form which has the list of all available items. You have an unbound textbox on the form, Call it oaCustomerID and set its recordsource to =OpenArgs. when you open the popup form you pass the customerID as an openArg such as
Code:
DoCmd.OpenForm "MyPopUpForm", , , , , , Me.CustomerID
Then when you select an item you do an insert into the table of orders using the customerID and ItemID from your popupform. when you close the popup form you requery your subform and the item(s) will be there.

heres an example

yes something like that but in the frmpopup can we put a filter? and make it look like a table?
and how i use the =[OpenArgs] ? i have no idea how you create it xD
 
Because I have list of 10000 items and combolist not helping me.

You have two major problems here, one a matter of technical limits and the other of practicality. Moke gave you the correct answer and you rejected it, perhaps because you are a bit timid to take the step as a relative newcomer to Access.

10k records in a combo box will be problematic because there is a limit to the number of items you can have in a combo box. You can see this limit if you open the tab File then under that open Options then under that, click Current Database. At the very bottom of that list of options is a limit that you can set for how many items to display. If you have not set this, then the default is usually 1000 items.

Part 2 is that you are giving yourself both eyestrain and headaches by not pre-filtering this information. I very strongly urge you to consider reading up on "cascading combo boxes" in order to first assert a filter on the items you could select and THEN show the list of filtered items to be used for final selection.
 
You have two major problems here, one a matter of technical limits and the other of practicality. Moke gave you the correct answer and you rejected it, perhaps because you are a bit timid to take the step as a relative newcomer to Access.

10k records in a combo box will be problematic because there is a limit to the number of items you can have in a combo box. You can see this limit if you open the tab File then under that open Options then under that, click Current Database. At the very bottom of that list of options is a limit that you can set for how many items to display. If you have not set this, then the default is usually 1000 items.

Part 2 is that you are giving yourself both eyestrain and headaches by not pre-filtering this information. I very strongly urge you to consider reading up on "cascading combo boxes" in order to first assert a filter on the items you could select and THEN show the list of filtered items to be used for final selection.

i dont get it why is so hard xD its supouse to be something simple let me explian for the last time meaby you will get the idea and help me.

i have a table called "Products"
i have a table called "Orders"
i have a table called "OrderProducts"

i have a form Named "OrderForm" with 2 fields
(From table Orders)Order Number:
(From table Products with a relasionship with OrderProducts)Product:

the "Product" field is in a sheet.
i want when i click on the field "Product" i get a popup table with my 3000 items and i can choose one after i filter and search and put it on the Field "Product" in my form.
can it be done?
 
I've been thinking about the 10,000 records (or 3000 whichever it may be)
I dont know that i would even want to load that many records into a form. I might construct an sql string limiting the number of returned records before loading my form. If traversing a network that may be really slow.

i dont get it why is so hard xD its supouse to be something simple
I hope you understand that we can not see what you have in front of you. We can only guess and try to point out various methods to help you with your project. If you upload you database that may help but i'm not sure i could read it if its not in english. This is not a difficult task and I've shown you one method of doing it but you ultimately have to dive in and try it for yourself.
 
I've been thinking about the 10,000 records (or 3000 whichever it may be)
I dont know that i would even want to load that many records into a form. I might construct an sql string limiting the number of returned records before loading my form. If traversing a network that may be really slow.


I hope you understand that we can not see what you have in front of you. We can only guess and try to point out various methods to help you with your project. If you upload you database that may help but i'm not sure i could read it if its not in english. This is not a difficult task and I've shown you one method of doing it but you ultimately have to dive in and try it for yourself.

i dont want to enter a 3000 vaules to a from i want to choose 2-3 of them from my table list to add to a specific field. i will try send you in exmaple soon. thanks for trying.
 

Users who are viewing this thread

Back
Top Bottom