List box question ...Please help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All....I have a table with following structure:

ClientID - Autonumber
ClientCID - PK(AlphaNumeric exact six digits)
ClientName - Alpha
EngagementName - Alpha
WeeklyActivity - Memo ---(There is a lot of information that goes here and I
cannot have it as a text field. It exceeds 255 characters).

What I am trying to do is have a form with upper box as list box that gives
Client Name and Engagement Name. The bottom box is a text box that should
display the weeklyactivity when clicked on appropriate client. I have a code
that easily displays the information in list box but once I click on any of
the client I cannot see anything in text box. How can I do that? Thanks for
all your help.

PS. I know I can build a form to view this but the requirement is to view it
as list box because the end user wants to view all of the engagement name at
once and click on any one he or she chooses to view weekly activity as
opposed to navigating through records on form.
 
Assuming a single select listbox (Multiselect is set to No), and assuming
that the bound column of the listbox is the column containing the ClientCID
field, use the AfterUpdate event of the listbox to run a DLookup function to
get the WeeklyActivity data:


Private Sub ListBoxName_AfterUpdate()
Me.TextBoxName.Value = DLookup("WeeklyActivity", "NameOfYourTable", _
"[ClientCID]=" & Me.ListBoxName.Value)
End Sub


It's unusual to have an autonumber field that is not the PK of the table.
Any particular reason you have both a ClientID field and a ClientCID field?
 
Back
Top