473,395 Members | 1,456 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,395 software developers and data experts.

Combo Box Populating Multiple Text Boxes

Hi everyone. I need help. I have a combo box in my form that i want to populate multiple text boxes after you select your selection in the combo box. Here is my set up.

The Fields that need to be populated are lsited below but must be recorded to a new table. Gets info from Course occurance Table.

Combo Box - Gets Information from Course Occurance Table. This table has all information regarding course information.

Course ID:
Course Name:
Hours:
End Date:

So after the selection is made from combo box. It populates these fields. Combo box gets info from course occurance table. The fields on the form are linked to the grades table on my data base. I want the info pulled from course occurance table then populate it in these fields . Which will then be recorded to the Grades Table. I have the combo box working just i cant figure out how to populate the fields. Please Help.

Sincerely,
Ray Z
Jul 10 '07 #1
6 8250
Im using Access 2007. Please Help!
Jul 10 '07 #2
puppydogbuddy
1,923 Expert 1GB
Im using Access 2007. Please Help!
If I understood correctly, you would use the AfterUpdate event of your combo to update the textboxes as shown below. Replace the generic names I used for your textboxes and your combo box with the actual names used in your application.
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCombo_AfterUpdate
  2.  
  3. If Not IsNull(Me!YourCombo) Then
  4.      Me!txtCourseID.Value  = Me!YourCombo.Column(0)
  5.      Me!txtCourseName.Value = Me!YourCombo.Column(1)
  6.      Me!txtCourseHours.Value = Me!YourCombo.Column(2)
  7.      Me!txtEndDate.Value = Me!YourCombo.Column(3)
  8.      Me.Requery
  9. End If
  10. End Sub
  11.  
Jul 10 '07 #3
Thanks. You are the Best. I appreciate it.
Jul 10 '07 #4
Thanks. You are the Best. I appreciate it.
By the way, I am having the same problem. My combo box has two fields from an underlying query called MMS and Rev. I want to requery the form based on these two values and only know how to do this for one value. My combo box has a name of Combo14 and I don't know how to refer to the values separately if you know what I mean. My code looks like this and worked when I just queried based on the MMS. When I decided I needed to query based on both MMS and Rev I got lost.

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[MMSCode] = '" & Me![Combo14] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Help. By the way, how do I get the answer to this question. I tried posting a question before and still have not figured out how to go see if someone answered it.

Thanks so much,
DeeDee
Jul 18 '07 #5
puppydogbuddy
1,923 Expert 1GB
By the way, I am having the same problem. My combo box has two fields from an underlying query called MMS and Rev. I want to requery the form based on these two values and only know how to do this for one value. My combo box has a name of Combo14 and I don't know how to refer to the values separately if you know what I mean. My code looks like this and worked when I just queried based on the MMS. When I decided I needed to query based on both MMS and Rev I got lost.

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[MMSCode] = '" & Me![Combo14] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Help. By the way, how do I get the answer to this question. I tried posting a question before and still have not figured out how to go see if someone answered it.

Thanks so much,
DeeDee
DeeDee,
If you click the hyperlink to your profile in upper left, you will see links to all your previous posts and threads. In regard to the problem with your combo, I need a little more info..............see below:
1. what are MMS and Rev ? what is the primary key to your table(s) that have MMS and Rev in them.
2. show me a one line sample of what the data looks like.
Jul 18 '07 #6
Thanks so much for your time. I just figured out how to get to the answers to my posts!!! Ha Ha.
I did get the answer to this problem. You use the .column() subscript to refer to each element in the combo box.

Now I can look for answers to my posts. I appreciate your help.
I'm new so forgive me.
DeeDee


DeeDee,
If you click the hyperlink to your profile in upper left, you will see links to all your previous posts and threads. In regard to the problem with your combo, I need a little more info..............see below:
1. what are MMS and Rev ? what is the primary key to your table(s) that have MMS and Rev in them.
2. show me a one line sample of what the data looks like.
Jul 27 '07 #7

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

Similar topics

1
by: Daniel Hill | last post by:
OK, I have very, VERY basic background knowledge of VB6 and have now upgraded to VB.NET and now I'm struggling to bring up the forms I want. What I am looking to do is to have a click a command...
7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
3
by: vgrssrtrs | last post by:
<html> <head> <script language="JavaScript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** ***Please do not remove this comment
2
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
1
by: Shawn Yates | last post by:
It has been a while since I have done anything on MS Access and I seem to be a bit rusty. I hope someone could help me solve my issue. I have a form that has multiple combo boxes on it. Each box...
2
by: Dave | last post by:
I have 3 tables of information feeding into 4 combo boxes on my main form (DR Form). I have as many list boxes (acting as text boxes) as there are fields in each one of the 3 tables. Once...
2
by: SPOILED36 | last post by:
I am building a database to track attendance. I have one main form with multiple subforms. Within one of the subforms name sfrDailyAttendance, I also have cascading combo boxes (cboCategory and...
2
by: SHAWTY721 | last post by:
I have a form that contains two combo boxes that are related to each other. I need to find a way to populate my text box based on the criteria of the two combo boxes so the appropriate number...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...

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.