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

hours and i still can't do it

in a form:
how do you automatically update a textbox after u've clicked a value
in combo box with the value matching in the same row.

eg. say you selected a name in the combo box, it will automatically
update two text boxes with matching addresses and birthdays from the
same row.
here's a rough sample code i've tried to implement which doesn't work

text4.value = "select distinctrow cables from [pricing]" _
& "Where rating = [forms]![pricing]![rating]"

i've spent hours. and tried different other things like on change etc.
still can;t get it. smart it dudes out there please help!

thanks
Mike
Nov 12 '05 #1
2 1266
There are a couple of ways.

1) You could include these 2 values in the Row Source of the combobox. Place
then in columns that have a width of 0". In the textboxes, you would set an
equation that refers to the column of the combobox.

Example:
=cboMyCombo.Column(1)

The column number is zero based, so the first column is 0, the second is 1,
etc.

2) You could use a DLookup function in the textboxes to lookup the data in a
table using a unique value from one of the columns in the combobox. You
would need to use this option if the desired data is not available in the
recordset that the row source comes from. This "unique value" would probably
be the PersonID or similar field.

=DLookup("Birthday", "tblBirthdays", "PersonID=" & cboMyCombo.Column(0))

--
Wayne Morgan
Microsoft Access MVP
"Michael La" <ni***********@yahoo.com> wrote in message
news:81*************************@posting.google.co m...
in a form:
how do you automatically update a textbox after u've clicked a value
in combo box with the value matching in the same row.

eg. say you selected a name in the combo box, it will automatically
update two text boxes with matching addresses and birthdays from the
same row.
here's a rough sample code i've tried to implement which doesn't work

text4.value = "select distinctrow cables from [pricing]" _
& "Where rating = [forms]![pricing]![rating]"

i've spent hours. and tried different other things like on change etc.
still can;t get it. smart it dudes out there please help!

thanks
Mike

Nov 12 '05 #2
Hi Wayne,

I've sometimes had trouble referring to a Combo box's columns directly from
the text box's Control Source.

So I usually use the combo box's AfterUpdate event to set the Text box
value.

e.g.
Private Sub cboAddressList_AfterUpdate()
txtAddress = cboAddressList.Column(1)
txtTown = cboAddressList.Column(2)
End Sub

Format the two text boxes so it's clear to the user that they can't be
updated - it'll save support calls!

It always works for me.

Andrew

"Wayne Morgan" <co***************************@hotmail.com> wrote in message
news:OI******************@newssvr33.news.prodigy.c om...
There are a couple of ways.

1) You could include these 2 values in the Row Source of the combobox. Place then in columns that have a width of 0". In the textboxes, you would set an equation that refers to the column of the combobox.

Example:
=cboMyCombo.Column(1)

The column number is zero based, so the first column is 0, the second is 1, etc.

2) You could use a DLookup function in the textboxes to lookup the data in a table using a unique value from one of the columns in the combobox. You
would need to use this option if the desired data is not available in the
recordset that the row source comes from. This "unique value" would probably be the PersonID or similar field.

=DLookup("Birthday", "tblBirthdays", "PersonID=" & cboMyCombo.Column(0))

--
Wayne Morgan
Microsoft Access MVP
"Michael La" <ni***********@yahoo.com> wrote in message
news:81*************************@posting.google.co m...
in a form:
how do you automatically update a textbox after u've clicked a value
in combo box with the value matching in the same row.

eg. say you selected a name in the combo box, it will automatically
update two text boxes with matching addresses and birthdays from the
same row.
here's a rough sample code i've tried to implement which doesn't work

text4.value = "select distinctrow cables from [pricing]" _
& "Where rating = [forms]![pricing]![rating]"

i've spent hours. and tried different other things like on change etc.
still can;t get it. smart it dudes out there please help!

thanks
Mike


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: anon | last post by:
Does anyone know how many man-hours were used in creating .NET 1.0? I thought it would be an interesting statistic to know. Thanks.
5
by: mitchchristensen | last post by:
I have a transaction log that tracks issues from a call center. Each time an issue is assigned to someone else, closed, etc. I get a time stamp. I have these time stamps for the beginning of an...
1
by: sg_s123 | last post by:
============================================================================ 02-Feb-04 03-Feb-04 Staff Staff 0800hr- 1300hr- 1700hr- 1900hr- 0800hr- 1300hr- 1700hr- 1900hr- Number...
5
by: Rebecca Smith | last post by:
I'm building log book to keep track of a racers stats during a long ultra marathon race. Things such as time on the bike, time off, H20 intake, electrolytes and the like. When I say long I mean...
1
by: serge | last post by:
Right now the database I am working with is storing time in an Integer data type and is storing the time value in seconds. The application does not allow entering seconds. It accepts minutes and...
22
by: Drum2001 | last post by:
I have a table that tracks employee times. I have a column (Date/Time). Users, through a form, enter how long it takes them to complete a task. For example, 03:45 = 3 hours and 45 mins. I am...
1
by: Brett | last post by:
Does anyone know how to calculate hours that go over 24? I am tracking how many hours & seconds our production keyers work everyday. When I run a query for a length of time that a given employee...
6
by: richbneal | last post by:
I really like the site so far and this is my first post. I have looked through some of the archives with no luck. I have also read the posting guidelines and will do my best to be clear and accurate...
3
by: sentiald | last post by:
I am having trouble with the following code. I need to have it calculate regular pay, overtime pay and gross pay and display it back to the user. Can anyone figure out where my problem lies. <?php...
1
by: 22dude | last post by:
it says the variable hours is being used with out being initializes i am using C++ 2005 express edition , I am currently student Please help me out to find the solution on my code below #...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.