473,398 Members | 2,368 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,398 software developers and data experts.

Help with sub form combo box

418 256MB
Question 1: I have a table called tblAccounts : fields are: AccountID (Auto), AcctNo (Text) and AcctDescr (Text)

In my expese sub form, I am trying to auto populate a text box called txtAcctDescr when I enter the account number in a combo box called cboSEAccount. How do I do this?

Question 2: I have another table called tblEmployees: first 3 fields are: EmployeeID (Auto), EmpLastName (text) & EmpFirstName (text)

In my expense sub form, I have a combo box called cboProjectMgr. Where I would like to display the names as First Name space Last Name. So I created an expression like this: Name: [EmpFirstName]& "" &[EmpLastName].

But I don't get to display the list as such. Nor am I able to select a name to populate the combo box on the sub form called cboProjectMgr.

How do I fix this problem?

Thanks for any help I can get.

Regards.
Apr 9 '09 #1
6 1340
ChipR
1,287 Expert 1GB
For question 1, you could put a line of code in the cboSEAccount AfterUpdate event to set the txtAcctDescr.
For question 2, make a query based on tblEmployees with the employeeID and Name:[...] fields. Set the cboProjectMgr to store the (hidden) EmployeeID and display the Name column.
Apr 9 '09 #2
NeoPa
32,556 Expert Mod 16PB
What's the Record Source for the ComboBox (cboProjectMgr) M?

Also, if it has multiple columns, which is the bound one?
Apr 9 '09 #3
MNNovice
418 256MB
NeoPa:

The record source for cboProjectMgr is tblEmployees. EmployeeID is the bound column.

I would like it to look up EmployeeID and then populate txtProjectMgr as for example, John (EmpFirstName) Smith (EmpLastName).

Thanks.
Apr 9 '09 #4
MNNovice
418 256MB
ChipR:

Thanks for your suggestions. Unfortunately I am not an expert in SQL and wouldn't know how to set the txtAcctDescr. Can you be a little for specific and/or detailed in your suggestion?

I will try the query option you mentioned. Shall keep you posted.

Many Thanks.
Apr 9 '09 #5
NeoPa
32,556 Expert Mod 16PB
@MNNovice
You should be able to use the .Column() property of the ComboBox (to refer idividually to the various fields in the table), or use DLookup() for each field separately (using the ID returned). I would suggest the .Column approach is far superior.
Apr 9 '09 #6
ChipR
1,287 Expert 1GB
You can go to the cboSEAccount combo box's Properties. On the Event tab, for After Update choose Code Builder. In that function you can add a line like:
Expand|Select|Wrap|Line Numbers
  1. txtAccountDescr = (whatever you want)
That should be all you need and it will happen whenever a value is chosen from the combo box.
Apr 9 '09 #7

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

Similar topics

2
by: mark | last post by:
I've been working on an Access 2000 database for a couple of weeks now. I took a course in access about a year ago, a crash course, and I learned a ton, but I didn't touch Access for the year since...
4
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
5
by: Steve Patrick | last post by:
Hi All You guys are my last hope, despite spending money on books and hours reading them I still can not achieve the results I need. I have designed a database in Access 2000 based on 1 table,...
14
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ;...
8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
9
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the...
5
by: CCLeasing | last post by:
Hello, I have searched google but can not find a straight forward answer to my problem. Hopefuly someone will be kind enough to offer their expertise. Please forgive if this seems a bit convoluted...
0
by: CCLeasing | last post by:
Hello, I have searched google but can not find a straight forward answer to my problem. Hopefuly someone will be kind enough to offer their expertise. Please forgive if this seems a bit convoluted...
5
by: deaconj999 | last post by:
Hi, I have nearly finished my database and I would like to add a query that uses a combo box to get the results, not the usual paramater style input. I suppose it would need a form and a query...
3
by: Strasser | last post by:
In a nested subform in datasheet view, an interviewer of homeless people picks a descriptive CATEGORY from 20 descriptive categories. The 20 categories are displayed via a combo box. (Categories...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.