Still need help with default value in combo box

G

Geordie

I got a response to my original question of 16 March
for "Al", but his suggestion to refer to the tab/page
control did not work, so here is a re-post to see if
somebody can help. I didn't say so the first time, but
both combo boxes get their information from the same
employeetable.
-----Original Message-----
Subject: Default value in combo box = value of another
combo box?
How do I get the value of one combo box to be the default
value in another combo box? in this instance, I want the
value of cboAsgEngID to be the default value for
cboSteEngID.

I have tried putting the following into Default Value of
cboSteEngID without success:
[me].[cboAsgEngID].[Value]
and
=[cboAsgEngID]

BTW, the two combos are on different tab control pages.

Thanks.


From: "Al" <[email protected]> Sent:
3/16/2004 2:02:55 PM

Because they are on different pages, my guess would be
that you need to reference the page name instead of
using "me". i.e [PageName].[cboAsgEngID].[Value]

At least that's what I would try... Good luck.
 
M

Marshall Barton

Geordie said:
I got a response to my original question of 16 March
for "Al", but his suggestion to refer to the tab/page
control did not work, so here is a re-post to see if
somebody can help. I didn't say so the first time, but
both combo boxes get their information from the same
employeetable.
-----Original Message-----
Subject: Default value in combo box = value of another
combo box?
How do I get the value of one combo box to be the default
value in another combo box? in this instance, I want the
value of cboAsgEngID to be the default value for
cboSteEngID.

I have tried putting the following into Default Value of
cboSteEngID without success:
[me].[cboAsgEngID].[Value]
and
=[cboAsgEngID]


Remember that the default value of a bound control is only
applied on the first keystroke anywhere in a new record.
So, if the first combo box is bound, the first combo can not
have a value at the time that second combo box's default
value is applied.

With that understanding, your question as stated doesn't
make sense. If you'd explain more about what you're trying
to achieve, maybe someone can provide an approach that will
meet your needs.
 
G

Geordie

Thanks, Marsh. Okay, what is happening is that an Assigned
Engineer (cboAsgEngID) is assigned to do a job. That
engineer may not necessarily be the engineer that actually
performs the work on-site: the cboSteEngID. Both get their
data from a query:

SELECT qryEmployees.EmployeeID, qryEmployees.FullName FROM
qryEmployees;

We anticipate that most of the time the assigned engineer
will be the same as the on-site engineer, so were hoping
that cboAsgEngID could be the default choice for
cboSiteEngID, whilst still allowing users to make a change
to cboSiteEngID if required.

Hope this makes sense, and help will be much appreciated.
 
M

Marshall Barton

Geordie said:
Thanks, Marsh. Okay, what is happening is that an Assigned
Engineer (cboAsgEngID) is assigned to do a job. That
engineer may not necessarily be the engineer that actually
performs the work on-site: the cboSteEngID. Both get their
data from a query:

SELECT qryEmployees.EmployeeID, qryEmployees.FullName FROM
qryEmployees;

We anticipate that most of the time the assigned engineer
will be the same as the on-site engineer, so were hoping
that cboAsgEngID could be the default choice for
cboSiteEngID, whilst still allowing users to make a change
to cboSiteEngID if required.

Hope this makes sense, and help will be much appreciated.


Ok, try using the assigned engineer combo box's AfterUpdate
event to set the value of the site engineer combo box:

If IsNull(Me.cboSteEngID) Then ' don't change if set
Me.cboSteEngID = Me.cboAsgEngID
End If
 
G

Geordie

Ta, Marsh.. works great!
-----Original Message-----
appreciated.


Ok, try using the assigned engineer combo box's AfterUpdate
event to set the value of the site engineer combo box:

If IsNull(Me.cboSteEngID) Then ' don't change if set
Me.cboSteEngID = Me.cboAsgEngID
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top