Re: Default value of combo box based on another that uses DLookUp
- From: "Bob Wickham" <wickham_bob@xxxxxxxxx>
- Date: Fri, 24 Aug 2007 12:44:14 +1000
Thanks for replying, Richard.
Default value or value?
Value. I want Combo2 to show what Combo1 is showing.
But everything I've tried has not automatically entered anything into
Combo2.
From your suggestion, the AfterUpdate of Combo1 now reads:Private Sub Default_Planwriter_AfterUpdate()
Me.PlanWriter = Me.Default_Planwriter
End Sub
Combo1(Default_Planwriter) displays the result of the DLookup, as it should.
Combo2(PlanWriter) does not display anything, nor do I get an error.
In fact the only way I can get Combo2 to display the name of a PlanWriter
automatically, is to hard code the PlanWriters numerical ID into the Default
Value property. Hard coding the actual name of the person does not display
anything.
So, do you think I'm right in assuming that Combo1 is returning a string and
Combo2 is expecting an integer.
Bob
"jrmask via AccessMonster.com" <u34599@uwe> wrote in message
news:7726a8e7a2f2e@xxxxxx
Default value or value? if the first combo is working correctly then in
the
AfterUpdate event set the second combo to equal the first (Me.Combo2 = Me.
Combo1). Then leave your lookup to the table in the second combo so that
if a
person needs they can change the value.
Bob Wickham wrote:
Hi,
I have a problem I'm trying to overcome regarding just one form which gets
its data from 1 table.
I'm trying to set the default value of a combo box to be the same as
another
combo box on the same form.
The scenario is:
I have a form for entering info about financial planning Statements Of
Advice.
Each client has a Plan Writer prepare their plan.
To find the plan writer that last prepared the plan for a client I have a
combo box with a DLookUp as its Control Source.
=DLookUp("Plan_Writer","qryDefault_Planwriter","[Client]=Form![Client]")
I'm using a query so as to find the most recent record for a client.
Works wonderfully! but this combo can only be used for display.
Now the part thats causing me grief.
I want the value returned by that DLookUp to be the default value for
another combo box with the Row Source of
SELECT tblPlanWriter.Plan_Writer_ID, tblPlanWriter.Plan_Writer FROM
tblPlanWriter;
The second combo must remain editable so that another plan writer can be
chosen if necessary
I've played around with all sorts of things, using the Expression Builder,
borrowing bits of code from all over the net, Before Update, After Update.
I cant find anything on the internet the same as what I'm attempting,
which
makes me wonder if what I want is even possible.
Thankyou
Bob
--
Richard Mask
Message posted via http://www.accessmonster.com
.
- Follow-Ups:
- Re: Default value of combo box based on another that uses DLookUp
- From: jrmask via AccessMonster.com
- Re: Default value of combo box based on another that uses DLookUp
- References:
- Default value of combo box based on another that uses DLookUp
- From: Bob Wickham
- Re: Default value of combo box based on another that uses DLookUp
- From: jrmask via AccessMonster.com
- Default value of combo box based on another that uses DLookUp
- Prev by Date: Re: If Statement Problem
- Next by Date: RE: For Each ??
- Previous by thread: Re: Default value of combo box based on another that uses DLookUp
- Next by thread: Re: Default value of combo box based on another that uses DLookUp
- Index(es):
Relevant Pages
|