473,326 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Populate combo box field on button click based on list box

Hey everybody,

I have a database with one major form that has a few subforms and a listbox, and on the form there are buttons that link to other forms as well. Once the list box is clicked on, the four subforms automatically populate based on the selection. The buttons that link to the other forms are designed to begin to add a record (based on what subform button was pressed).

I want to find a way for the first field in the newly opened form (after a button click) to populate based on my list box selection. I'm totally 'cluless' about how to do this and would erally appreciate it if somebody could help me. Thanks!
Jul 28 '09 #1
1 3145
ChipR
1,287 Expert 1GB
Two options for this. In the Form_Open, you can save the value in an invisible box by
1) reference the list box with Forms![MainFormName]![ListBoxName]
2) Use the OpenArgs of the DoCmd.OpenForm, then in the new form's Form_Open(), use the predefined OpenArgs. Basically, pass the value to the newly opened form.
Then, in On_Current(), set the field equal to the value saved in the text box.
Jul 28 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: William Bradley | last post by:
I have a need to construct a combo box that will fill in two fields, on a form,from a single table. The table: "IndexNo", "Product","Supplier","Address" etc. What I would like to do is be...
6
by: William Bradley | last post by:
I have a production table and its accompanying form. There can be up to ten ingredients in what is produced. The ingredients are obtained from the incoming goods table which supplies the two...
10
by: motessa | last post by:
Hello All, I am new to Access and have been looking for answers to my problem on the internet and have not found it yet. I hope someone can give me a hint. Thanks so much. I have a form...
4
by: Mike L | last post by:
I'm open for any suggestions on how to better program this. I want the user to select a license from a combo box, cboPrivilege and then the user will click the add button, then a record will be...
1
by: Jimmy Stewart | last post by:
Is there a way to set up a combo box so that when the user clicks the arrow, the list is populated with info from a specific field from a table but once they select an option, data from another...
4
by: virtualgreek | last post by:
Dear All, First of all I would like to take the time to thank you all for your efforts and time spent at this wonderful forum. I have found it very helpful with numerous examples available for...
5
FOE2272
by: FOE2272 | last post by:
I have tried every option that I can think of and most of them on this forum. The closest that I got was to bring up the field but it changed the other records based on what was chosen in one...
4
by: whamo | last post by:
I have the need to populate a field based on the selection in a combo box. Starting out simple. (2) tables tbl_OSE_Info and tbl_Input; tbl_OSE_Info has three fields: Key, OSE_Name and OSE_Wt...
2
by: banderson | last post by:
Hello, I have a data entry form for a table with information about buildings and am having a problem making a combo box do what I want. I would like to make the combo box show a list of unique bldg...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.