473,805 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting Textbox Value to Combo Box

1 New Member
I have the following situation in Access 2003 I need some help on:

I have a form that I would like to set up so that when a user selects a time (Quarter/Year) from a combo box, the next field, a textbox, automatically selects the corresponding date.

This form is running from a table "Quarters", and within this are four columns: "Quarter" "Start Date" "End Date" and "Year"

combo box = cboCombo3
Column Count = 2
Column Width = 1
Row Source = SELECT Quarters.Quarte r, Quarters.StartD ate FROM Quarters;
Event: After Update Code =
Private Sub cboCombo3_After Update()
Me!txtStartDate = Me!cboCombo3.Co lumn(1)
End Sub
Control Source = Quarter

textbox = txtStartDate
Control Source = Start Date

When I try and select a value in my combo box in the Form View I get a box that pops up saying "Enter Parameter Value" and "Quarters.Start Date"

Not sure what the problem is, but possible solutions would be much appreciated.
Jun 21 '07 #1
1 1735
JKing
1,206 Recognized Expert Top Contributor
Seems to me like you're referencing the wrong field name.
You want to reference Start Date but you're referencing StartDate under the row source for your combo box.

Change this line to:
Row Source = SELECT Quarters.Quarte r, Quarters.[Start Date] FROM Quarters;

Adding the [] allows you to use field names that contain spaces without them being misinterpreted.
Jun 21 '07 #2

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

Similar topics

0
1124
by: CSDunn | last post by:
Hello, I have a subform where the 'Name' and 'Source Object' properties are both 'frmSelectByTestSUB'. This subform resides in a main form called 'frmSelectByTest'. In the subform, I have a combo box currently named 'Combo6' that displays a list of student names. I need to set up functionality so that after the name in the combo box is selected (After Update?), a textbox that is bound to a field called 'TestGrade' will have its value...
0
1269
by: CSDunn | last post by:
Hello, I have a subform where the 'Name' and 'Source Object' properties are both 'frmSelectByTestSUB'. This subform resides in a main form called 'frmSelectByTest'. In the subform, I have a combo box currently named 'Combo6' that displays a list of student names. I need to set up functionality so that after the name in the combo box is selected (After Update?), a textbox that is bound to a field called 'TestGrade' will have its value...
1
6179
by: Will | last post by:
I have a combo box on a form which is based on table tblMachine. On that combo box I have four columns visible MachineNumber, description, location and type. The bound column is the MachineNumber and this is not set to 0 as the machines have its number on which means the user should know the machine number. My problem is if the user doesn't know the number. I have a button which changes the row source of the combo box to order by...
2
41297
by: | last post by:
Hi everyone, I have a form with a combo box on it. When you select a value (a PO#) from the combo box, the bound field is the indexID of the selected PO. On the same form, I have a text box that I'd like to feed from a query I've built. The query does some math and comes up with a number (qty allocated) for the selected PO. There are two tricky parts here. That query I've built needs to filter on the indexID that gets selected from...
2
1975
by: colleen1980 | last post by:
There is a textbox and a drop down. Once user enters any value in the textbox he has to select the option from drop down otherwise the cursor will not allow to move anywhere else accept the drop down and the textbox unless it delete the value from the textbox how to i do that needs help
7
2845
by: luanhoxung | last post by:
hi all!! i get small trouble in display a text box. My text box will be show a value string base on my combo box choice. But text box always get the same value when i choose a new value in combo box. ex: combo box---text box AA 123<--change 456<--change 789 BB 456 <--change 789 CC 789
0
1928
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 but this is probabally a reflection of my not clear understanding of the mechanics behind what i'm trying to achieve. Please bear with it I really could do with your help. I have a simple windows form. There are two controls on the form that I...
3
3155
by: technocraze | last post by:
Hi community experts, May I knw whether is it possible to display the corresponding value of the second textbox based on the user input in the first textbox? This means that once the user enters the value of first textbox - S1, the corresponding matching value based on first textbox will be displayed in the second textbox automatically. I have tried using the AfterUpdate() event of textbox1 control to trigger this scenario but doesnt seem...
7
3586
by: Brad Pears | last post by:
I have something strange going on - pretty sure it used to work before - and now it does not... Why does the following code not clear a combo box? Me.cboLocation.Text = String.Empty OR Me.cboLocation.Text = ""
0
9716
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10607
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10364
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9182
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7645
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5541
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.