Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default value 1

Status
Not open for further replies.

Buj123

Programmer
Jan 5, 2004
96
US
Hello,
I have table with Cause and CauseDescription.
cause causeDescription
BOM BOM errors
COM Communication Errors

In the Form only Cause(Dropdown) will be shown up, and based on that cause in the Table the causeDescription should fill.
Like if the user selects "COM" in Cause dropdown in the form, then in table it should write it as "Communication" in CauseDescription. How to set that?
 
Buj123

There are several approaches to this, but perhaps the easiest is to use the colmn(x) property of a combo box.

First, make sure the query for the combo box includes the field for the description. For example, it may look something like...

SELECT Cause, CauseDescription from YourCauseTable
ORDERBY Cause

The combo box will display the first column.

Then create an event for the combo box for After Update

Code would look something like....
Code:
If Len(Nz(Me.Casue)) > 0 Then
   Me.CauseDescription = Me.Cause.Column(1)
End If

I am making assumptions on your field names and such; adjust accordingly.

Note that Access often starts counting from 0. Therefore column(1) is the second column.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top