Still Struggling...

A

Aria

I'm really sorry, Beetle. You've lost me. I don't think this is turning out
right on my end. I've tried countless times. I don't see anything that says
Record Selectors. I'll try again tomorrow. Right now, I'm working on a
computer that has Access 2000. I don't know if that makes any difference. If
it does, tomorrow, I'll try on a computer with Access 2003.
I also need to check our discussions to see why we have a junction table for
EmpClassifications. There must be a good reason but it escapes me right now.
--
Aria W.


Beetle said:
OK, so what you need to do is use subforms for this. I'll use Titles as an
example. The junction table (tblEmpTitles) stores the data that defines
the relationship, so you add another subform that uses the junction table
as it's recordsource. The junction table should have these fields;

EmpID
TitleID

Now, if you are using the wizard, Access will create text boxes and labels
for each of these fields. I would delete both the text box and the label
for EmpID (it's usually not a good idea to display ID numbers to users) and
the label for TitleID. Then change the TitleID text box to a combo box with
the following properties (if you're not using the wizard, just start with a
combo box to begin with);

Control Source = TitleID (in tblEmpTitles)
Row Source = Select TitleID, TitleDescription From tblTitles OrderBy
TitleDescription
Bound Column = 1
Column Count = 2
Column Widths = 0,1

Now you can manipulate the size an appearance of the subform so that
it appears to be just a group of combo boxes on your form. For example
you might set the width so that it is only as wide as your combo box, and
set the height so that the user could view maybe two or three combo
boxes at once. Other properties of the form you may want to change
might be;

Default View = Continuous
Scroll Bars = Vertical Only
Record Selectors = No
Navigation Buttons = No
Border Style = Thin

This way, when you make a selection in the combo box, the associated ID
numbers will be properly stored in tblEmpTitles, and you have the ability
to assign more than one title to an employee.

--
_________

Sean Bailey


Aria said:
Yes, that's correct.
--
Aria W.


Beetle284 via AccessMonster.com said:
You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
junction
tables for each of them, is that correct?

Aria wrote:
I was talking specifically about tables, not forms.

I'm very sorry; my mistake.

I'm working with frmEmployees with sfrmSiteEmps. The problem appears to be
cboTitleDescription. I deleted the combo box a couple of days ago in trying
to isolate the problem. I saved the form without cboTitleDescription. When I
opened the form today and cycled through the records, cboTitleClassification
appears to work as expected. I then created a new combo box for Title
Description; same error message as before. The Control Source is
TitleDescription. The Row Source is SELECT [tblTitles].[TitleID], [tblTitles].
[TitleDescription] FROM tblTitles; The Column count is 2. The Column Widths
are 0";1". The Bound Column is 1.

Just for clarification, in one of my previous posts, when I stated the
following;
[quoted text clipped - 28 lines]
gonna
start :- )

--
________________________

Sean Bailey
s b a i l e y 2 8 4 AT e c e n t r a l DOT c o m
 
B

BruceM

I'm just sort of popping in as time permits, so this will not be a thorough
reply. Record Selectors is a property on the Format tab of the form's
Property Sheet. If it is Yes you will see a bar on the left side of the
window, with an arrow pointing to the current record and an asterisk for the
new record (in a continuous form). In a single form I think you just see
the arrow for every record.
The drop-down list isn't in alphabetical order because you didn't tell it to
be. In Sean's Row Source SQL there is an Order By statement. This
determines the sort order. If you use a named query as the Row Source there
is an Order By statement in the query. To see the query's underlying
language (I don't recall if you know this), open the query and click View >>
SQL.
Just to stress the point, the combo box has a Row Source, which determines
the list the user will see when clicking the down arrow. A combo box is a
control that may be bound to a field, so it may also have a Control Source,
which is a field in the form's Record Source. The combo box is not based on
tblTitles, but rather is bound to a single field in tblTitles. When you
make a selection from the combo box, the bound column in the combo box Row
Source is written to the field in the table. If EmployeeID is the (hidden)
bound column, and FullName is the visible column, selecting a name will
cause the associated EmployeeID to be stored in the combo box Control Source
field.

Aria said:
I didn't give you all of the information that you requested. The problem is
on the main form. The recordsource, I believe is tblTitles. I think I
found
the answer to one of my problems. The drop-list isn't in alpha order
because
the sort was based on qryTitles, but the combo box is based on tblTitles.

--
Aria W.


Aria said:
Yes, that's correct.
--
Aria W.


Beetle284 via AccessMonster.com said:
You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
junction
tables for each of them, is that correct?

Aria wrote:
I was talking specifically about tables, not forms.

I'm very sorry; my mistake.

I'm working with frmEmployees with sfrmSiteEmps. The problem appears
to be
cboTitleDescription. I deleted the combo box a couple of days ago in
trying
to isolate the problem. I saved the form without cboTitleDescription.
When I
opened the form today and cycled through the records,
cboTitleClassification
appears to work as expected. I then created a new combo box for Title
Description; same error message as before. The Control Source is
TitleDescription. The Row Source is SELECT [tblTitles].[TitleID],
[tblTitles].
[TitleDescription] FROM tblTitles; The Column count is 2. The Column
Widths
are 0";1". The Bound Column is 1.

Just for clarification, in one of my previous posts, when I stated
the
following;
[quoted text clipped - 28 lines]
gonna
start :- )

--
________________________

Sean Bailey
s b a i l e y 2 8 4 AT e c e n t r a l DOT c o m
 
A

Aria

Thanks, Bruce. I finally found it. I'm still working on it but I think I may
be getting closer. I had to make the combo box because I could not get the
wizard to give me what I think I need. It created 2 scroll bars (1 vertical
and 1 horizontal). I couldn't see the labels and couldn't scroll to the
labels. The horizontal bar stayed even though I had switched it to vertical
only. Should I delete the other combo box we originally made. The one that is
giving the invalid value message? It's now giving me a couple of new messages.

1. Form/subform can't be set to continues veiw. Microsoft will set to single
form.

2. Syntax error in From clause. I double checked to see if I had input
"FromtblTitles" correctly. It seem to be correct so I'm not sure what the
problem is there.

My other question is about the Control Source. I'm supposed to put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be referenced? I'm just
trying to clarify because I don't see anything else that refers to
tblTitlesEmps. Or will it be recorded in both places because TitleID is a
field in both tblTitles and tblTitlesEmps?


--
Aria W.


BruceM said:
I'm just sort of popping in as time permits, so this will not be a thorough
reply. Record Selectors is a property on the Format tab of the form's
Property Sheet. If it is Yes you will see a bar on the left side of the
window, with an arrow pointing to the current record and an asterisk for the
new record (in a continuous form). In a single form I think you just see
the arrow for every record.
The drop-down list isn't in alphabetical order because you didn't tell it to
be. In Sean's Row Source SQL there is an Order By statement. This
determines the sort order. If you use a named query as the Row Source there
is an Order By statement in the query. To see the query's underlying
language (I don't recall if you know this), open the query and click View >>
SQL.
Just to stress the point, the combo box has a Row Source, which determines
the list the user will see when clicking the down arrow. A combo box is a
control that may be bound to a field, so it may also have a Control Source,
which is a field in the form's Record Source. The combo box is not based on
tblTitles, but rather is bound to a single field in tblTitles. When you
make a selection from the combo box, the bound column in the combo box Row
Source is written to the field in the table. If EmployeeID is the (hidden)
bound column, and FullName is the visible column, selecting a name will
cause the associated EmployeeID to be stored in the combo box Control Source
field.

Aria said:
I didn't give you all of the information that you requested. The problem is
on the main form. The recordsource, I believe is tblTitles. I think I
found
the answer to one of my problems. The drop-list isn't in alpha order
because
the sort was based on qryTitles, but the combo box is based on tblTitles.

--
Aria W.


Aria said:
Yes, that's correct.
--
Aria W.


:

You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
junction
tables for each of them, is that correct?

Aria wrote:
I was talking specifically about tables, not forms.

I'm very sorry; my mistake.

I'm working with frmEmployees with sfrmSiteEmps. The problem appears
to be
cboTitleDescription. I deleted the combo box a couple of days ago in
trying
to isolate the problem. I saved the form without cboTitleDescription.
When I
opened the form today and cycled through the records,
cboTitleClassification
appears to work as expected. I then created a new combo box for Title
Description; same error message as before. The Control Source is
TitleDescription. The Row Source is SELECT [tblTitles].[TitleID],
[tblTitles].
[TitleDescription] FROM tblTitles; The Column count is 2. The Column
Widths
are 0";1". The Bound Column is 1.

Just for clarification, in one of my previous posts, when I stated
the
following;
[quoted text clipped - 28 lines]
gonna
start :- )

--
________________________

Sean Bailey
s b a i l e y 2 8 4 AT e c e n t r a l DOT c o m
 
B

Beetle

The horizontal bar stayed even though I had switched it to vertical only.

Are you talking about in design view or regular form view? In design view
both scroll bars will appear regardless.
Should I delete the other combo box we originally made. The one that is
giving the invalid value message?
Yes

1. Form/subform can't be set to continues veiw. Microsoft will set to single
form.

Not sure why that would be unless you put the subform inside a form that
is already continuous. You can't have a continuous subform inside another
continuous form/subform.
2. Syntax error in From clause. I double checked to see if I had input
"FromtblTitles" correctly. It seem to be correct so I'm not sure what the
problem is there.

It may help if you copy and paste your row source SQL.
My other question is about the Control Source. I'm supposed to put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be referenced? I'm just
trying to clarify because I don't see anything else that refers to
tblTitlesEmps. Or will it be recorded in both places because TitleID is a
field in both tblTitles and tblTitlesEmps?

Yes. The record source of the subform should be tblTitlesEmps and the
control source of the combo box should be TitleID from that table. The
appropriate TitleID from tblTitles (which comes from the *row* source of
the combo box) will be recorded in tblTitlesEmps (via the *control* source
of the combo box).

Hopefully, this is making sense to you.
--
_________

Sean Bailey


Aria said:
Thanks, Bruce. I finally found it. I'm still working on it but I think I may
be getting closer. I had to make the combo box because I could not get the
wizard to give me what I think I need. It created 2 scroll bars (1 vertical
and 1 horizontal). I couldn't see the labels and couldn't scroll to the
labels. The horizontal bar stayed even though I had switched it to vertical
only. Should I delete the other combo box we originally made. The one that is
giving the invalid value message? It's now giving me a couple of new messages.

1. Form/subform can't be set to continues veiw. Microsoft will set to single
form.

2. Syntax error in From clause. I double checked to see if I had input
"FromtblTitles" correctly. It seem to be correct so I'm not sure what the
problem is there.

My other question is about the Control Source. I'm supposed to put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be referenced? I'm just
trying to clarify because I don't see anything else that refers to
tblTitlesEmps. Or will it be recorded in both places because TitleID is a
field in both tblTitles and tblTitlesEmps?


--
Aria W.


BruceM said:
I'm just sort of popping in as time permits, so this will not be a thorough
reply. Record Selectors is a property on the Format tab of the form's
Property Sheet. If it is Yes you will see a bar on the left side of the
window, with an arrow pointing to the current record and an asterisk for the
new record (in a continuous form). In a single form I think you just see
the arrow for every record.
The drop-down list isn't in alphabetical order because you didn't tell it to
be. In Sean's Row Source SQL there is an Order By statement. This
determines the sort order. If you use a named query as the Row Source there
is an Order By statement in the query. To see the query's underlying
language (I don't recall if you know this), open the query and click View >>
SQL.
Just to stress the point, the combo box has a Row Source, which determines
the list the user will see when clicking the down arrow. A combo box is a
control that may be bound to a field, so it may also have a Control Source,
which is a field in the form's Record Source. The combo box is not based on
tblTitles, but rather is bound to a single field in tblTitles. When you
make a selection from the combo box, the bound column in the combo box Row
Source is written to the field in the table. If EmployeeID is the (hidden)
bound column, and FullName is the visible column, selecting a name will
cause the associated EmployeeID to be stored in the combo box Control Source
field.

Aria said:
I didn't give you all of the information that you requested. The problem is
on the main form. The recordsource, I believe is tblTitles. I think I
found
the answer to one of my problems. The drop-list isn't in alpha order
because
the sort was based on qryTitles, but the combo box is based on tblTitles.

--
Aria W.


:

Yes, that's correct.
--
Aria W.


:

You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
junction
tables for each of them, is that correct?

Aria wrote:
I was talking specifically about tables, not forms.

I'm very sorry; my mistake.

I'm working with frmEmployees with sfrmSiteEmps. The problem appears
to be
cboTitleDescription. I deleted the combo box a couple of days ago in
trying
to isolate the problem. I saved the form without cboTitleDescription.
When I
opened the form today and cycled through the records,
cboTitleClassification
appears to work as expected. I then created a new combo box for Title
Description; same error message as before. The Control Source is
TitleDescription. The Row Source is SELECT [tblTitles].[TitleID],
[tblTitles].
[TitleDescription] FROM tblTitles; The Column count is 2. The Column
Widths
are 0";1". The Bound Column is 1.

Just for clarification, in one of my previous posts, when I stated
the
following;
[quoted text clipped - 28 lines]
gonna
start :- )

--
________________________

Sean Bailey
s b a i l e y 2 8 4 AT e c e n t r a l DOT c o m
 
A

Aria

OK, so what you need to do is use subforms for this.I'll use Titles as an
example. The junction table (tblEmpTitles) stores the data that defines
the relationship, so you add another subform that uses the junction table as it's recordsource.

I'm sorry; maybe I've misunderstood... There is a combo box for Class
Description on the form tblEmployees which contains a subform, tblSiteEmps. I
deleted the combo box for Title Description on this form and frmTitles. Am I
creating a new subform for frmTitles or frmEmployees?
In design view both scroll bars will appear regardless.

Yes, this is in design view. I can't see the labels and I can't scroll to
the labels. Even when I try to re size it the result is the same. I can
possibly delete the text box for EmpID and the label too if I catch the tip,
but I can't see or reach the label for TitleID to change it into a combo box
with the horizontal scroll bar in the way. I must be missing something.

(if you're not using the wizard, just start with a combo box to begin with);

This is on frmTitles, correct?
Not sure why that would be unless you put the subform inside a form >that is already continuous. You can't have a continuous subform inside >another continuous form/subform.

Other properties of the form you may want to change might be;
Default View = Continuous

I assumed you meant for me to set this property for frmTitles, although I
may be mistaken. As far as I can see, the only one set to continuous is
frmTitles. The other forms, frmEmployees, frmClassifications and sfrmSiteEmps
is set to single form.
It may help if you copy and paste your row source SQL.

After I used the wizard to make the combo box it said this:

SELECT [tblTitlesEmps].[EmpID], [tblTitlesEmps].[TitleID] FROM
[tblTitlesEmps]

I then changed it to what you had which was this:
SELECT TitleID, TitleDescription From tblTitles OrderBy TitleDescription
Hopefully, this is making sense to you.

Not yet, but I'm still trying...

Thanks for your help.



--
Aria W.


Beetle said:
The horizontal bar stayed even though I had switched it to vertical only.

Are you talking about in design view or regular form view? In design view
both scroll bars will appear regardless.
Should I delete the other combo box we originally made. The one that is
giving the invalid value message?
Yes

1. Form/subform can't be set to continues veiw. Microsoft will set to single
form.

Not sure why that would be unless you put the subform inside a form that
is already continuous. You can't have a continuous subform inside another
continuous form/subform.
2. Syntax error in From clause. I double checked to see if I had input
"FromtblTitles" correctly. It seem to be correct so I'm not sure what the
problem is there.

It may help if you copy and paste your row source SQL.
My other question is about the Control Source. I'm supposed to put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be referenced? I'm just
trying to clarify because I don't see anything else that refers to
tblTitlesEmps. Or will it be recorded in both places because TitleID is a
field in both tblTitles and tblTitlesEmps?

Yes. The record source of the subform should be tblTitlesEmps and the
control source of the combo box should be TitleID from that table. The
appropriate TitleID from tblTitles (which comes from the *row* source of
the combo box) will be recorded in tblTitlesEmps (via the *control* source
of the combo box).

Hopefully, this is making sense to you.
--
_________

Sean Bailey


Aria said:
Thanks, Bruce. I finally found it. I'm still working on it but I think I may
be getting closer. I had to make the combo box because I could not get the
wizard to give me what I think I need. It created 2 scroll bars (1 vertical
and 1 horizontal). I couldn't see the labels and couldn't scroll to the
labels. The horizontal bar stayed even though I had switched it to vertical
only. Should I delete the other combo box we originally made. The one that is
giving the invalid value message? It's now giving me a couple of new messages.

1. Form/subform can't be set to continues veiw. Microsoft will set to single
form.

2. Syntax error in From clause. I double checked to see if I had input
"FromtblTitles" correctly. It seem to be correct so I'm not sure what the
problem is there.

My other question is about the Control Source. I'm supposed to put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be referenced? I'm just
trying to clarify because I don't see anything else that refers to
tblTitlesEmps. Or will it be recorded in both places because TitleID is a
field in both tblTitles and tblTitlesEmps?


--
Aria W.


BruceM said:
I'm just sort of popping in as time permits, so this will not be a thorough
reply. Record Selectors is a property on the Format tab of the form's
Property Sheet. If it is Yes you will see a bar on the left side of the
window, with an arrow pointing to the current record and an asterisk for the
new record (in a continuous form). In a single form I think you just see
the arrow for every record.
The drop-down list isn't in alphabetical order because you didn't tell it to
be. In Sean's Row Source SQL there is an Order By statement. This
determines the sort order. If you use a named query as the Row Source there
is an Order By statement in the query. To see the query's underlying
language (I don't recall if you know this), open the query and click View >>
SQL.
Just to stress the point, the combo box has a Row Source, which determines
the list the user will see when clicking the down arrow. A combo box is a
control that may be bound to a field, so it may also have a Control Source,
which is a field in the form's Record Source. The combo box is not based on
tblTitles, but rather is bound to a single field in tblTitles. When you
make a selection from the combo box, the bound column in the combo box Row
Source is written to the field in the table. If EmployeeID is the (hidden)
bound column, and FullName is the visible column, selecting a name will
cause the associated EmployeeID to be stored in the combo box Control Source
field.

I didn't give you all of the information that you requested. The problem is
on the main form. The recordsource, I believe is tblTitles. I think I
found
the answer to one of my problems. The drop-list isn't in alpha order
because
the sort was based on qryTitles, but the combo box is based on tblTitles.

--
Aria W.


:

Yes, that's correct.
--
Aria W.


:

You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
junction
tables for each of them, is that correct?

Aria wrote:
I was talking specifically about tables, not forms.

I'm very sorry; my mistake.

I'm working with frmEmployees with sfrmSiteEmps. The problem appears
to be
cboTitleDescription. I deleted the combo box a couple of days ago in
trying
to isolate the problem. I saved the form without cboTitleDescription.
When I
opened the form today and cycled through the records,
cboTitleClassification
appears to work as expected. I then created a new combo box for Title
Description; same error message as before. The Control Source is
TitleDescription. The Row Source is SELECT [tblTitles].[TitleID],
[tblTitles].
[TitleDescription] FROM tblTitles; The Column count is 2. The Column
Widths
are 0";1". The Bound Column is 1.

Just for clarification, in one of my previous posts, when I stated
the
following;
[quoted text clipped - 28 lines]
gonna
start :- )

--
________________________

Sean Bailey
s b a i l e y 2 8 4 AT e c e n t r a l DOT c o m
 
B

Beetle

OK. I would like to make sure I have a clear understanding of the forms
you currently have. From what I can tell, you have the following;

frmEmployees
Record Source = tblEmployees
Default View = Single Form
Purpose = enter general info about all employees

sfrmSiteEmps (a subform of frmEmployees)
Record Source = tblSiteEmps
Default View = Single Form
Purpose = enter address and other info related to full time staff

frmTitles (which I think is a subform in frmEmployees ?)
Record Source = tblTitlesEmps (the junction table)?
Default View = Continuous ?
Purpose = select the appropriate Title(s) for each employee ?

frmClassifications (which I think is also a subform in frmEmployees ?)
Record Source = tblEmpClassifications (the junction table) ?
Default View = Continuous ?
Purpose = select the appropriate Classification(s) for each employee ?

Is this correct?

--
_________

Sean Bailey


Aria said:
OK, so what you need to do is use subforms for this.I'll use Titles as an
example. The junction table (tblEmpTitles) stores the data that defines
the relationship, so you add another subform that uses the junction table as it's recordsource.

I'm sorry; maybe I've misunderstood... There is a combo box for Class
Description on the form tblEmployees which contains a subform, tblSiteEmps. I
deleted the combo box for Title Description on this form and frmTitles. Am I
creating a new subform for frmTitles or frmEmployees?
In design view both scroll bars will appear regardless.

Yes, this is in design view. I can't see the labels and I can't scroll to
the labels. Even when I try to re size it the result is the same. I can
possibly delete the text box for EmpID and the label too if I catch the tip,
but I can't see or reach the label for TitleID to change it into a combo box
with the horizontal scroll bar in the way. I must be missing something.

(if you're not using the wizard, just start with a combo box to begin with);

This is on frmTitles, correct?
Not sure why that would be unless you put the subform inside a form >that is already continuous. You can't have a continuous subform inside >another continuous form/subform.

Other properties of the form you may want to change might be;
Default View = Continuous

I assumed you meant for me to set this property for frmTitles, although I
may be mistaken. As far as I can see, the only one set to continuous is
frmTitles. The other forms, frmEmployees, frmClassifications and sfrmSiteEmps
is set to single form.
It may help if you copy and paste your row source SQL.

After I used the wizard to make the combo box it said this:

SELECT [tblTitlesEmps].[EmpID], [tblTitlesEmps].[TitleID] FROM
[tblTitlesEmps]

I then changed it to what you had which was this:
SELECT TitleID, TitleDescription From tblTitles OrderBy TitleDescription
Hopefully, this is making sense to you.

Not yet, but I'm still trying...

Thanks for your help.



--
Aria W.


Beetle said:
The horizontal bar stayed even though I had switched it to vertical only.

Are you talking about in design view or regular form view? In design view
both scroll bars will appear regardless.
Should I delete the other combo box we originally made. The one that is
giving the invalid value message?
Yes

1. Form/subform can't be set to continues veiw. Microsoft will set to single
form.

Not sure why that would be unless you put the subform inside a form that
is already continuous. You can't have a continuous subform inside another
continuous form/subform.
2. Syntax error in From clause. I double checked to see if I had input
"FromtblTitles" correctly. It seem to be correct so I'm not sure what the
problem is there.

It may help if you copy and paste your row source SQL.
My other question is about the Control Source. I'm supposed to put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be referenced? I'm just
trying to clarify because I don't see anything else that refers to
tblTitlesEmps. Or will it be recorded in both places because TitleID is a
field in both tblTitles and tblTitlesEmps?

Yes. The record source of the subform should be tblTitlesEmps and the
control source of the combo box should be TitleID from that table. The
appropriate TitleID from tblTitles (which comes from the *row* source of
the combo box) will be recorded in tblTitlesEmps (via the *control* source
of the combo box).

Hopefully, this is making sense to you.
--
_________

Sean Bailey


Aria said:
Thanks, Bruce. I finally found it. I'm still working on it but I think I may
be getting closer. I had to make the combo box because I could not get the
wizard to give me what I think I need. It created 2 scroll bars (1 vertical
and 1 horizontal). I couldn't see the labels and couldn't scroll to the
labels. The horizontal bar stayed even though I had switched it to vertical
only. Should I delete the other combo box we originally made. The one that is
giving the invalid value message? It's now giving me a couple of new messages.

1. Form/subform can't be set to continues veiw. Microsoft will set to single
form.

2. Syntax error in From clause. I double checked to see if I had input
"FromtblTitles" correctly. It seem to be correct so I'm not sure what the
problem is there.

My other question is about the Control Source. I'm supposed to put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be referenced? I'm just
trying to clarify because I don't see anything else that refers to
tblTitlesEmps. Or will it be recorded in both places because TitleID is a
field in both tblTitles and tblTitlesEmps?


--
Aria W.


:

I'm just sort of popping in as time permits, so this will not be a thorough
reply. Record Selectors is a property on the Format tab of the form's
Property Sheet. If it is Yes you will see a bar on the left side of the
window, with an arrow pointing to the current record and an asterisk for the
new record (in a continuous form). In a single form I think you just see
the arrow for every record.
The drop-down list isn't in alphabetical order because you didn't tell it to
be. In Sean's Row Source SQL there is an Order By statement. This
determines the sort order. If you use a named query as the Row Source there
is an Order By statement in the query. To see the query's underlying
language (I don't recall if you know this), open the query and click View >>
SQL.
Just to stress the point, the combo box has a Row Source, which determines
the list the user will see when clicking the down arrow. A combo box is a
control that may be bound to a field, so it may also have a Control Source,
which is a field in the form's Record Source. The combo box is not based on
tblTitles, but rather is bound to a single field in tblTitles. When you
make a selection from the combo box, the bound column in the combo box Row
Source is written to the field in the table. If EmployeeID is the (hidden)
bound column, and FullName is the visible column, selecting a name will
cause the associated EmployeeID to be stored in the combo box Control Source
field.

I didn't give you all of the information that you requested. The problem is
on the main form. The recordsource, I believe is tblTitles. I think I
found
the answer to one of my problems. The drop-list isn't in alpha order
because
the sort was based on qryTitles, but the combo box is based on tblTitles.

--
Aria W.


:

Yes, that's correct.
--
Aria W.


:

You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
junction
tables for each of them, is that correct?

Aria wrote:
I was talking specifically about tables, not forms.

I'm very sorry; my mistake.

I'm working with frmEmployees with sfrmSiteEmps. The problem appears
to be
cboTitleDescription. I deleted the combo box a couple of days ago in
trying
to isolate the problem. I saved the form without cboTitleDescription.
When I
opened the form today and cycled through the records,
cboTitleClassification
appears to work as expected. I then created a new combo box for Title
Description; same error message as before. The Control Source is
TitleDescription. The Row Source is SELECT [tblTitles].[TitleID],
[tblTitles].
[TitleDescription] FROM tblTitles; The Column count is 2. The Column
Widths
are 0";1". The Bound Column is 1.

Just for clarification, in one of my previous posts, when I stated
the
following;
[quoted text clipped - 28 lines]
gonna
start :- )

--
________________________

Sean Bailey
s b a i l e y 2 8 4 AT e c e n t r a l DOT c o m
 
A

Aria

frmEmployees
Record Source = tblEmployees
Default View = Single Form
Purpose = enter general info about all employees

Correct (subs and site staff).
sfrmSiteEmps (a subform of frmEmployees)
Record Source = tblSiteEmps
Default View = Single Form
Purpose = enter address and other info related to full time staff
Correct.

frmTitles (which I think is a subform in frmEmployees ?)
Record Source = tblTitlesEmps (the junction table)?
Default View = Continuous ?
Purpose = select the appropriate Title(s) for each employee ?

I believe this might be where the problem lies. Currently, it's a form. I
was trying to make a subform based on your post yesterday, but I was unsure
exactly what you meant. I didn't understand why this wouldn't be a subform of
tblEmployees. You mentioned Titles (tblTitles? frmTitles?) but since I didn't
quite understand what you meant, I tried it both ways to see if I could get
what I think I need.
frmClassifications (which I think is also a subform in frmEmployees ?)
Record Source = tblEmpClassifications (the junction table) ?
Default View = Continuous ?
Purpose = select the appropriate Classification(s) for each employee ?

No, this is not a subform. This is a form. The combo box is part of
tblEmployees. I did not experience the error message that I received with
cboTitles so I left it alone.

BTW, I re-read all of our discussions about Titles and Classifications and
for the life of me cannot figure out why we have this junction table,
EmpsClass. Each employee can only have one classification although many
employees can have the same classification. I think that would be 1:M. The
only thing I remember discussing concerning dual classifications were
administrators but we were leaving them as is. I'll leave it alone for now.


--
Aria W.


Beetle said:
OK. I would like to make sure I have a clear understanding of the forms
you currently have. From what I can tell, you have the following;

frmEmployees
Record Source = tblEmployees
Default View = Single Form
Purpose = enter general info about all employees

sfrmSiteEmps (a subform of frmEmployees)
Record Source = tblSiteEmps
Default View = Single Form
Purpose = enter address and other info related to full time staff

frmTitles (which I think is a subform in frmEmployees ?)
Record Source = tblTitlesEmps (the junction table)?
Default View = Continuous ?
Purpose = select the appropriate Title(s) for each employee ?

frmClassifications (which I think is also a subform in frmEmployees ?)
Record Source = tblEmpClassifications (the junction table) ?
Default View = Continuous ?
Purpose = select the appropriate Classification(s) for each employee ?

Is this correct?

--
_________

Sean Bailey


Aria said:
OK, so what you need to do is use subforms for this.I'll use Titles as an
example. The junction table (tblEmpTitles) stores the data that defines
the relationship, so you add another subform that uses the junction table as it's recordsource.

I'm sorry; maybe I've misunderstood... There is a combo box for Class
Description on the form tblEmployees which contains a subform, tblSiteEmps. I
deleted the combo box for Title Description on this form and frmTitles. Am I
creating a new subform for frmTitles or frmEmployees?
In design view both scroll bars will appear regardless.

Yes, this is in design view. I can't see the labels and I can't scroll to
the labels. Even when I try to re size it the result is the same. I can
possibly delete the text box for EmpID and the label too if I catch the tip,
but I can't see or reach the label for TitleID to change it into a combo box
with the horizontal scroll bar in the way. I must be missing something.

(if you're not using the wizard, just start with a combo box to begin with);

This is on frmTitles, correct?
Not sure why that would be unless you put the subform inside a form >that is already continuous. You can't have a continuous subform inside >another continuous form/subform.

Other properties of the form you may want to change might be;
Default View = Continuous

I assumed you meant for me to set this property for frmTitles, although I
may be mistaken. As far as I can see, the only one set to continuous is
frmTitles. The other forms, frmEmployees, frmClassifications and sfrmSiteEmps
is set to single form.
It may help if you copy and paste your row source SQL.

After I used the wizard to make the combo box it said this:

SELECT [tblTitlesEmps].[EmpID], [tblTitlesEmps].[TitleID] FROM
[tblTitlesEmps]

I then changed it to what you had which was this:
SELECT TitleID, TitleDescription From tblTitles OrderBy TitleDescription
Hopefully, this is making sense to you.

Not yet, but I'm still trying...

Thanks for your help.



--
Aria W.


Beetle said:
The horizontal bar stayed even though I had switched it to vertical only.

Are you talking about in design view or regular form view? In design view
both scroll bars will appear regardless.

Should I delete the other combo box we originally made. The one that is
giving the invalid value message?

Yes

1. Form/subform can't be set to continues veiw. Microsoft will set to single
form.

Not sure why that would be unless you put the subform inside a form that
is already continuous. You can't have a continuous subform inside another
continuous form/subform.

2. Syntax error in From clause. I double checked to see if I had input
"FromtblTitles" correctly. It seem to be correct so I'm not sure what the
problem is there.

It may help if you copy and paste your row source SQL.

My other question is about the Control Source. I'm supposed to put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be referenced? I'm just
trying to clarify because I don't see anything else that refers to
tblTitlesEmps. Or will it be recorded in both places because TitleID is a
field in both tblTitles and tblTitlesEmps?

Yes. The record source of the subform should be tblTitlesEmps and the
control source of the combo box should be TitleID from that table. The
appropriate TitleID from tblTitles (which comes from the *row* source of
the combo box) will be recorded in tblTitlesEmps (via the *control* source
of the combo box).

Hopefully, this is making sense to you.
--
_________

Sean Bailey


:

Thanks, Bruce. I finally found it. I'm still working on it but I think I may
be getting closer. I had to make the combo box because I could not get the
wizard to give me what I think I need. It created 2 scroll bars (1 vertical
and 1 horizontal). I couldn't see the labels and couldn't scroll to the
labels. The horizontal bar stayed even though I had switched it to vertical
only. Should I delete the other combo box we originally made. The one that is
giving the invalid value message? It's now giving me a couple of new messages.

1. Form/subform can't be set to continues veiw. Microsoft will set to single
form.

2. Syntax error in From clause. I double checked to see if I had input
"FromtblTitles" correctly. It seem to be correct so I'm not sure what the
problem is there.

My other question is about the Control Source. I'm supposed to put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be referenced? I'm just
trying to clarify because I don't see anything else that refers to
tblTitlesEmps. Or will it be recorded in both places because TitleID is a
field in both tblTitles and tblTitlesEmps?


--
Aria W.


:

I'm just sort of popping in as time permits, so this will not be a thorough
reply. Record Selectors is a property on the Format tab of the form's
Property Sheet. If it is Yes you will see a bar on the left side of the
window, with an arrow pointing to the current record and an asterisk for the
new record (in a continuous form). In a single form I think you just see
the arrow for every record.
The drop-down list isn't in alphabetical order because you didn't tell it to
be. In Sean's Row Source SQL there is an Order By statement. This
determines the sort order. If you use a named query as the Row Source there
is an Order By statement in the query. To see the query's underlying
language (I don't recall if you know this), open the query and click View >>
SQL.
Just to stress the point, the combo box has a Row Source, which determines
the list the user will see when clicking the down arrow. A combo box is a
control that may be bound to a field, so it may also have a Control Source,
which is a field in the form's Record Source. The combo box is not based on
tblTitles, but rather is bound to a single field in tblTitles. When you
make a selection from the combo box, the bound column in the combo box Row
Source is written to the field in the table. If EmployeeID is the (hidden)
bound column, and FullName is the visible column, selecting a name will
cause the associated EmployeeID to be stored in the combo box Control Source
field.

I didn't give you all of the information that you requested. The problem is
on the main form. The recordsource, I believe is tblTitles. I think I
found
the answer to one of my problems. The drop-list isn't in alpha order
because
the sort was based on qryTitles, but the combo box is based on tblTitles.

--
Aria W.


:

Yes, that's correct.
--
Aria W.


:

You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
junction
tables for each of them, is that correct?

Aria wrote:
I was talking specifically about tables, not forms.

I'm very sorry; my mistake.

I'm working with frmEmployees with sfrmSiteEmps. The problem appears
to be
cboTitleDescription. I deleted the combo box a couple of days ago in
trying
to isolate the problem. I saved the form without cboTitleDescription.
When I
opened the form today and cycled through the records,
cboTitleClassification
appears to work as expected. I then created a new combo box for Title
Description; same error message as before. The Control Source is
TitleDescription. The Row Source is SELECT [tblTitles].[TitleID],
[tblTitles].
[TitleDescription] FROM tblTitles; The Column count is 2. The Column
Widths
are 0";1". The Bound Column is 1.

Just for clarification, in one of my previous posts, when I stated
the
following;
[quoted text clipped - 28 lines]
gonna
start :- )

--
________________________

Sean Bailey
s b a i l e y 2 8 4 AT e c e n t r a l DOT c o m
 
B

Beetle

I believe this might be where the problem lies. Currently, it's a form. I
was trying to make a subform based on your post yesterday, but I was unsure
exactly what you meant. I didn't understand why this wouldn't be a subform of
tblEmployees. You mentioned Titles (tblTitles? frmTitles?) but since I didn't
quite understand what you meant, I tried it both ways to see if I could get
what I think I need

It *should* be a subform in frmEmployees. It's recordsource should be
tblTitlesEmps. It should have a combo box that has EmpID (from tblTitlesEmps)
as the control source, and the row source of this combo box should be
a SQL statement like the one I posted previously, which gets its values
from tblTitles.
BTW, I re-read all of our discussions about Titles and Classifications and
for the life of me cannot figure out why we have this junction table,
EmpsClass. Each employee can only have one classification although many
employees can have the same classification. I think that would be 1:M. The
only thing I remember discussing concerning dual classifications were
administrators but we were leaving them as is. I'll leave it alone for now.

In that case, then you need a field in tblEmployees for ClassID as a FK, since
tblEmployees would be the "many" side of the relationship. Then in your
frmEmployees you would just add a combo box that is bound to this field
(the control source), and the row source would be something like;

Select ClassID, ClassDescription From tblClassifications OrderBy
ClassDescription

Bound Column = 1
Column Count = 2
Column Widths = 0,1

You would not need tblEmpClassifications (the junction table) in this case.


--
_________

Sean Bailey


Aria said:
frmEmployees
Record Source = tblEmployees
Default View = Single Form
Purpose = enter general info about all employees

Correct (subs and site staff).
sfrmSiteEmps (a subform of frmEmployees)
Record Source = tblSiteEmps
Default View = Single Form
Purpose = enter address and other info related to full time staff
Correct.

frmTitles (which I think is a subform in frmEmployees ?)
Record Source = tblTitlesEmps (the junction table)?
Default View = Continuous ?
Purpose = select the appropriate Title(s) for each employee ?

I believe this might be where the problem lies. Currently, it's a form. I
was trying to make a subform based on your post yesterday, but I was unsure
exactly what you meant. I didn't understand why this wouldn't be a subform of
tblEmployees. You mentioned Titles (tblTitles? frmTitles?) but since I didn't
quite understand what you meant, I tried it both ways to see if I could get
what I think I need.
frmClassifications (which I think is also a subform in frmEmployees ?)
Record Source = tblEmpClassifications (the junction table) ?
Default View = Continuous ?
Purpose = select the appropriate Classification(s) for each employee ?

No, this is not a subform. This is a form. The combo box is part of
tblEmployees. I did not experience the error message that I received with
cboTitles so I left it alone.

BTW, I re-read all of our discussions about Titles and Classifications and
for the life of me cannot figure out why we have this junction table,
EmpsClass. Each employee can only have one classification although many
employees can have the same classification. I think that would be 1:M. The
only thing I remember discussing concerning dual classifications were
administrators but we were leaving them as is. I'll leave it alone for now.


--
Aria W.


Beetle said:
OK. I would like to make sure I have a clear understanding of the forms
you currently have. From what I can tell, you have the following;

frmEmployees
Record Source = tblEmployees
Default View = Single Form
Purpose = enter general info about all employees

sfrmSiteEmps (a subform of frmEmployees)
Record Source = tblSiteEmps
Default View = Single Form
Purpose = enter address and other info related to full time staff

frmTitles (which I think is a subform in frmEmployees ?)
Record Source = tblTitlesEmps (the junction table)?
Default View = Continuous ?
Purpose = select the appropriate Title(s) for each employee ?

frmClassifications (which I think is also a subform in frmEmployees ?)
Record Source = tblEmpClassifications (the junction table) ?
Default View = Continuous ?
Purpose = select the appropriate Classification(s) for each employee ?

Is this correct?

--
_________

Sean Bailey


Aria said:
OK, so what you need to do is use subforms for this.I'll use Titles as an
example. The junction table (tblEmpTitles) stores the data that defines
the relationship, so you add another subform that uses the junction table as it's recordsource.

I'm sorry; maybe I've misunderstood... There is a combo box for Class
Description on the form tblEmployees which contains a subform, tblSiteEmps. I
deleted the combo box for Title Description on this form and frmTitles. Am I
creating a new subform for frmTitles or frmEmployees?

In design view both scroll bars will appear regardless.

Yes, this is in design view. I can't see the labels and I can't scroll to
the labels. Even when I try to re size it the result is the same. I can
possibly delete the text box for EmpID and the label too if I catch the tip,
but I can't see or reach the label for TitleID to change it into a combo box
with the horizontal scroll bar in the way. I must be missing something.

(if you're not using the wizard, just start with a combo box to begin with);

This is on frmTitles, correct?

Not sure why that would be unless you put the subform inside a form >that is already continuous. You can't have a continuous subform inside >another continuous form/subform.

Other properties of the form you may want to change might be;
Default View = Continuous

I assumed you meant for me to set this property for frmTitles, although I
may be mistaken. As far as I can see, the only one set to continuous is
frmTitles. The other forms, frmEmployees, frmClassifications and sfrmSiteEmps
is set to single form.

It may help if you copy and paste your row source SQL.

After I used the wizard to make the combo box it said this:

SELECT [tblTitlesEmps].[EmpID], [tblTitlesEmps].[TitleID] FROM
[tblTitlesEmps]

I then changed it to what you had which was this:
SELECT TitleID, TitleDescription From tblTitles OrderBy TitleDescription

Hopefully, this is making sense to you.

Not yet, but I'm still trying...

Thanks for your help.



--
Aria W.


:

The horizontal bar stayed even though I had switched it to vertical only.

Are you talking about in design view or regular form view? In design view
both scroll bars will appear regardless.

Should I delete the other combo box we originally made. The one that is
giving the invalid value message?

Yes

1. Form/subform can't be set to continues veiw. Microsoft will set to single
form.

Not sure why that would be unless you put the subform inside a form that
is already continuous. You can't have a continuous subform inside another
continuous form/subform.

2. Syntax error in From clause. I double checked to see if I had input
"FromtblTitles" correctly. It seem to be correct so I'm not sure what the
problem is there.

It may help if you copy and paste your row source SQL.

My other question is about the Control Source. I'm supposed to put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be referenced? I'm just
trying to clarify because I don't see anything else that refers to
tblTitlesEmps. Or will it be recorded in both places because TitleID is a
field in both tblTitles and tblTitlesEmps?

Yes. The record source of the subform should be tblTitlesEmps and the
control source of the combo box should be TitleID from that table. The
appropriate TitleID from tblTitles (which comes from the *row* source of
the combo box) will be recorded in tblTitlesEmps (via the *control* source
of the combo box).

Hopefully, this is making sense to you.
--
_________

Sean Bailey


:

Thanks, Bruce. I finally found it. I'm still working on it but I think I may
be getting closer. I had to make the combo box because I could not get the
wizard to give me what I think I need. It created 2 scroll bars (1 vertical
and 1 horizontal). I couldn't see the labels and couldn't scroll to the
labels. The horizontal bar stayed even though I had switched it to vertical
only. Should I delete the other combo box we originally made. The one that is
giving the invalid value message? It's now giving me a couple of new messages.

1. Form/subform can't be set to continues veiw. Microsoft will set to single
form.

2. Syntax error in From clause. I double checked to see if I had input
"FromtblTitles" correctly. It seem to be correct so I'm not sure what the
problem is there.

My other question is about the Control Source. I'm supposed to put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be referenced? I'm just
trying to clarify because I don't see anything else that refers to
tblTitlesEmps. Or will it be recorded in both places because TitleID is a
field in both tblTitles and tblTitlesEmps?


--
Aria W.


:

I'm just sort of popping in as time permits, so this will not be a thorough
reply. Record Selectors is a property on the Format tab of the form's
Property Sheet. If it is Yes you will see a bar on the left side of the
window, with an arrow pointing to the current record and an asterisk for the
new record (in a continuous form). In a single form I think you just see
the arrow for every record.
The drop-down list isn't in alphabetical order because you didn't tell it to
be. In Sean's Row Source SQL there is an Order By statement. This
determines the sort order. If you use a named query as the Row Source there
is an Order By statement in the query. To see the query's underlying
language (I don't recall if you know this), open the query and click View >>
SQL.
Just to stress the point, the combo box has a Row Source, which determines
the list the user will see when clicking the down arrow. A combo box is a
control that may be bound to a field, so it may also have a Control Source,
which is a field in the form's Record Source. The combo box is not based on
tblTitles, but rather is bound to a single field in tblTitles. When you
make a selection from the combo box, the bound column in the combo box Row
Source is written to the field in the table. If EmployeeID is the (hidden)
bound column, and FullName is the visible column, selecting a name will
cause the associated EmployeeID to be stored in the combo box Control Source
field.

I didn't give you all of the information that you requested. The problem is
on the main form. The recordsource, I believe is tblTitles. I think I
found
the answer to one of my problems. The drop-list isn't in alpha order
because
the sort was based on qryTitles, but the combo box is based on tblTitles.

--
Aria W.


:

Yes, that's correct.
--
Aria W.


:

You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
junction
tables for each of them, is that correct?

Aria wrote:
I was talking specifically about tables, not forms.

I'm very sorry; my mistake.

I'm working with frmEmployees with sfrmSiteEmps. The problem appears
to be
cboTitleDescription. I deleted the combo box a couple of days ago in
trying
to isolate the problem. I saved the form without cboTitleDescription.
When I
opened the form today and cycled through the records,
cboTitleClassification
appears to work as expected. I then created a new combo box for Title
Description; same error message as before. The Control Source is
TitleDescription. The Row Source is SELECT [tblTitles].[TitleID],
[tblTitles].
[TitleDescription] FROM tblTitles; The Column count is 2. The Column
Widths
are 0";1". The Bound Column is 1.

Just for clarification, in one of my previous posts, when I stated
the
following;
[quoted text clipped - 28 lines]
gonna
start :- )

--
________________________

Sean Bailey
s b a i l e y 2 8 4 AT e c e n t r a l DOT c o m
 
A

Aria

Well on a bright note; cboClassifications is working well. The only thing it
doesn't say in the SQL statement is Order By ClassDescription. I think
because I ran a query *before* I created the combo box. I'm afraid to change
it in case I end up with problems in this one too. Right now, I'm really
frustrated with creating this subform. It isn't working and I don't know how
to fix it.
These are the steps Ive taken:
1. Recordsource=tblTitlesEmps
2. Deleted text box and label for TitleID.
3. Changed label for EmpID to combo box.
4. Set EmpID as the control source.
5. Set Default view=Continuous
6. Unsure of this step since you stated, "...should be
a SQL statement like the one I posted previously, which gets its values
from tblTitles. I input the statement you provided yesterday, "Select TitleID, TitleDescription From tblTitles Order By TitleDescription

I believe this is the same statement that is working for cboClassifications.
I think it returned the same message as before; there is a problem with the
FROM clause. It also wasn't a continuous form even though I had changed the
default view. Then I started trying a lot of different things like changing
it to TitleID as in yesterday's post; same message. Then I tried creating a
query based on tblTitlesEmps referencing TitleDescription. I didn't get the
FROM message but it didn't return any values. I know I should post the SQL
statement but I deleted it. I deleted everything that didn't return the value
I need. I know...it isn't helpful. I going to back away from this right now
and try again tomorrow.
--
Aria W.


Beetle said:
I believe this might be where the problem lies. Currently, it's a form. I
was trying to make a subform based on your post yesterday, but I was unsure
exactly what you meant. I didn't understand why this wouldn't be a subform of
tblEmployees. You mentioned Titles (tblTitles? frmTitles?) but since I didn't
quite understand what you meant, I tried it both ways to see if I could get
what I think I need

It *should* be a subform in frmEmployees. It's recordsource should be
tblTitlesEmps. It should have a combo box that has EmpID (from tblTitlesEmps)
as the control source, and the row source of this combo box should be
a SQL statement like the one I posted previously, which gets its values
from tblTitles.
BTW, I re-read all of our discussions about Titles and Classifications and
for the life of me cannot figure out why we have this junction table,
EmpsClass. Each employee can only have one classification although many
employees can have the same classification. I think that would be 1:M. The
only thing I remember discussing concerning dual classifications were
administrators but we were leaving them as is. I'll leave it alone for now.

In that case, then you need a field in tblEmployees for ClassID as a FK, since
tblEmployees would be the "many" side of the relationship. Then in your
frmEmployees you would just add a combo box that is bound to this field
(the control source), and the row source would be something like;

Select ClassID, ClassDescription From tblClassifications OrderBy
ClassDescription

Bound Column = 1
Column Count = 2
Column Widths = 0,1

You would not need tblEmpClassifications (the junction table) in this case.


--
_________

Sean Bailey


Aria said:
frmEmployees
Record Source = tblEmployees
Default View = Single Form
Purpose = enter general info about all employees

Correct (subs and site staff).
sfrmSiteEmps (a subform of frmEmployees)
Record Source = tblSiteEmps
Default View = Single Form
Purpose = enter address and other info related to full time staff
Correct.

frmTitles (which I think is a subform in frmEmployees ?)
Record Source = tblTitlesEmps (the junction table)?
Default View = Continuous ?
Purpose = select the appropriate Title(s) for each employee ?

I believe this might be where the problem lies. Currently, it's a form. I
was trying to make a subform based on your post yesterday, but I was unsure
exactly what you meant. I didn't understand why this wouldn't be a subform of
tblEmployees. You mentioned Titles (tblTitles? frmTitles?) but since I didn't
quite understand what you meant, I tried it both ways to see if I could get
what I think I need.
frmClassifications (which I think is also a subform in frmEmployees ?)
Record Source = tblEmpClassifications (the junction table) ?
Default View = Continuous ?
Purpose = select the appropriate Classification(s) for each employee ?

No, this is not a subform. This is a form. The combo box is part of
tblEmployees. I did not experience the error message that I received with
cboTitles so I left it alone.

BTW, I re-read all of our discussions about Titles and Classifications and
for the life of me cannot figure out why we have this junction table,
EmpsClass. Each employee can only have one classification although many
employees can have the same classification. I think that would be 1:M. The
only thing I remember discussing concerning dual classifications were
administrators but we were leaving them as is. I'll leave it alone for now.


--
Aria W.


Beetle said:
OK. I would like to make sure I have a clear understanding of the forms
you currently have. From what I can tell, you have the following;

frmEmployees
Record Source = tblEmployees
Default View = Single Form
Purpose = enter general info about all employees

sfrmSiteEmps (a subform of frmEmployees)
Record Source = tblSiteEmps
Default View = Single Form
Purpose = enter address and other info related to full time staff

frmTitles (which I think is a subform in frmEmployees ?)
Record Source = tblTitlesEmps (the junction table)?
Default View = Continuous ?
Purpose = select the appropriate Title(s) for each employee ?

frmClassifications (which I think is also a subform in frmEmployees ?)
Record Source = tblEmpClassifications (the junction table) ?
Default View = Continuous ?
Purpose = select the appropriate Classification(s) for each employee ?

Is this correct?

--
_________

Sean Bailey


:

OK, so what you need to do is use subforms for this.I'll use Titles as an
example. The junction table (tblEmpTitles) stores the data that defines
the relationship, so you add another subform that uses the junction table as it's recordsource.

I'm sorry; maybe I've misunderstood... There is a combo box for Class
Description on the form tblEmployees which contains a subform, tblSiteEmps. I
deleted the combo box for Title Description on this form and frmTitles. Am I
creating a new subform for frmTitles or frmEmployees?

In design view both scroll bars will appear regardless.

Yes, this is in design view. I can't see the labels and I can't scroll to
the labels. Even when I try to re size it the result is the same. I can
possibly delete the text box for EmpID and the label too if I catch the tip,
but I can't see or reach the label for TitleID to change it into a combo box
with the horizontal scroll bar in the way. I must be missing something.

(if you're not using the wizard, just start with a combo box to begin with);

This is on frmTitles, correct?

Not sure why that would be unless you put the subform inside a form >that is already continuous. You can't have a continuous subform inside >another continuous form/subform.

Other properties of the form you may want to change might be;
Default View = Continuous

I assumed you meant for me to set this property for frmTitles, although I
may be mistaken. As far as I can see, the only one set to continuous is
frmTitles. The other forms, frmEmployees, frmClassifications and sfrmSiteEmps
is set to single form.

It may help if you copy and paste your row source SQL.

After I used the wizard to make the combo box it said this:

SELECT [tblTitlesEmps].[EmpID], [tblTitlesEmps].[TitleID] FROM
[tblTitlesEmps]

I then changed it to what you had which was this:
SELECT TitleID, TitleDescription From tblTitles OrderBy TitleDescription

Hopefully, this is making sense to you.

Not yet, but I'm still trying...

Thanks for your help.



--
Aria W.


:

The horizontal bar stayed even though I had switched it to vertical only.

Are you talking about in design view or regular form view? In design view
both scroll bars will appear regardless.

Should I delete the other combo box we originally made. The one that is
giving the invalid value message?

Yes

1. Form/subform can't be set to continues veiw. Microsoft will set to single
form.

Not sure why that would be unless you put the subform inside a form that
is already continuous. You can't have a continuous subform inside another
continuous form/subform.

2. Syntax error in From clause. I double checked to see if I had input
"FromtblTitles" correctly. It seem to be correct so I'm not sure what the
problem is there.

It may help if you copy and paste your row source SQL.

My other question is about the Control Source. I'm supposed to put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be referenced? I'm just
trying to clarify because I don't see anything else that refers to
tblTitlesEmps. Or will it be recorded in both places because TitleID is a
field in both tblTitles and tblTitlesEmps?

Yes. The record source of the subform should be tblTitlesEmps and the
control source of the combo box should be TitleID from that table. The
appropriate TitleID from tblTitles (which comes from the *row* source of
the combo box) will be recorded in tblTitlesEmps (via the *control* source
of the combo box).

Hopefully, this is making sense to you.
--
_________

Sean Bailey


:

Thanks, Bruce. I finally found it. I'm still working on it but I think I may
be getting closer. I had to make the combo box because I could not get the
wizard to give me what I think I need. It created 2 scroll bars (1 vertical
and 1 horizontal). I couldn't see the labels and couldn't scroll to the
labels. The horizontal bar stayed even though I had switched it to vertical
only. Should I delete the other combo box we originally made. The one that is
giving the invalid value message? It's now giving me a couple of new messages.

1. Form/subform can't be set to continues veiw. Microsoft will set to single
form.

2. Syntax error in From clause. I double checked to see if I had input
"FromtblTitles" correctly. It seem to be correct so I'm not sure what the
problem is there.

My other question is about the Control Source. I'm supposed to put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be referenced? I'm just
trying to clarify because I don't see anything else that refers to
tblTitlesEmps. Or will it be recorded in both places because TitleID is a
field in both tblTitles and tblTitlesEmps?


--
Aria W.


:

I'm just sort of popping in as time permits, so this will not be a thorough
reply. Record Selectors is a property on the Format tab of the form's
Property Sheet. If it is Yes you will see a bar on the left side of the
window, with an arrow pointing to the current record and an asterisk for the
new record (in a continuous form). In a single form I think you just see
the arrow for every record.
The drop-down list isn't in alphabetical order because you didn't tell it to
be. In Sean's Row Source SQL there is an Order By statement. This
determines the sort order. If you use a named query as the Row Source there
is an Order By statement in the query. To see the query's underlying
language (I don't recall if you know this), open the query and click View >>
SQL.
Just to stress the point, the combo box has a Row Source, which determines
the list the user will see when clicking the down arrow. A combo box is a
control that may be bound to a field, so it may also have a Control Source,
which is a field in the form's Record Source. The combo box is not based on
tblTitles, but rather is bound to a single field in tblTitles. When you
make a selection from the combo box, the bound column in the combo box Row
Source is written to the field in the table. If EmployeeID is the (hidden)
bound column, and FullName is the visible column, selecting a name will
cause the associated EmployeeID to be stored in the combo box Control Source
field.
I didn't give you all of the information that you requested. The problem is
on the main form. The recordsource, I believe is tblTitles. I think I
found
the answer to one of my problems. The drop-list isn't in alpha order
because
the sort was based on qryTitles, but the combo box is based on tblTitles.

--
Aria W.


:

Yes, that's correct.
--
Aria W.


:

You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
 
B

BruceM

Maybe I'm not doing much good by jumping in occasionally, but I'm going to
jump in again anyhow. These are some observations and comments based on my
reading of the thread.

As I recall, tblTitlesEmps is a junction table comprising TitleID and
EmployeeID fields. A query based on tblTitlesEmps can therefore return only
those fields. A query can only return fields that are in the tables (or
queries) on which the query is based. Maybe I'm stating something you
already know, but there seems to be a disconnect somewhere. I'm not sure
what you mean by "a query based on tblTitlesEmps referencing
TitleDescription". Maybe you mean you are including tblTitles in the query,
but if this is about displaying information on the Titles subform (which is
based on tblTitleEmps), the following about combo boxes may help.
Regarding combo boxes, I suspect a disconnect with the concept of Row Source
and Control Source. Think of it this way (don't do it, but rather just
picture it; this is a thought experiment only): Instead of having a combo
box to select the Title for the Employee you have a text box in which you
input the TitleID (which is a number field, as I recall; the
TitleDescription is a separate field). In order for you to input the
numbers you need a separate list of Titles and their ID numbers. If the
Title is Math Teacher you look on the list and see that the ID for Math
Teacher is 123, so you input 123 into the TitleID text box. In order to see
the text "Math Teacher" in addition to the number 123 you need to add
tblTitles to the form's Record Source query.
Instead of doing all that, your combo box Row Source takes the place of the
printout you needed in order to work with the TitleID text box. The combo
box *stores* TitleID just as happened with the text box, but it *displays*
TitleDescription. The displayed text is a convenience for the user. The
combo box Row Source SQL or stored query means you don't need to include
tblTitles in the subform's Record Source query.

In case you haven't discovered it yet, if your combo box Row Source is
something like:
Select TitleID, TitleDescription From tblTitles Order By TitleDescription
you can click the three dots next to Row Source to view this as a query
design grid. You can also switch to datasheet view to be sure the SQL
produces the expected results. I can't see why the FROM clause isn't
working, but if you switch to design view and datasheet view you may be able
to discover something. BTW, the Row Source SQL doesn't use leading or
closing quotes. I don't know if they are in the postings for clarity or if
they are part of the SQL.

Just to be sure you are clear on the terms SQL and Query, they are the same
thing for purposes of this discussion. SQL is the language behind the
queries. If you are going to use a particular Row Source SQL for combo
boxes on other forms you may want to create and save a query, then used the
named query for the Row Source rather than typing the SQL each time. It
makes no difference to Access which you choose (maybe there's a slight
performance advantage one way or the other, but that is of no concern now).

Again, I may be restating what you already know, but I have lost track of
some of the details of what has been discussed here.

Aria said:
Well on a bright note; cboClassifications is working well. The only thing
it
doesn't say in the SQL statement is Order By ClassDescription. I think
because I ran a query *before* I created the combo box. I'm afraid to
change
it in case I end up with problems in this one too. Right now, I'm really
frustrated with creating this subform. It isn't working and I don't know
how
to fix it.
These are the steps Ive taken:
1. Recordsource=tblTitlesEmps
2. Deleted text box and label for TitleID.
3. Changed label for EmpID to combo box.
4. Set EmpID as the control source.
5. Set Default view=Continuous
6. Unsure of this step since you stated, "...should be
a SQL statement like the one I posted previously, which gets its values
from tblTitles. I input the statement you provided yesterday, "Select
TitleID, TitleDescription From tblTitles Order By TitleDescription

I believe this is the same statement that is working for
cboClassifications.
I think it returned the same message as before; there is a problem with
the
FROM clause. It also wasn't a continuous form even though I had changed
the
default view. Then I started trying a lot of different things like
changing
it to TitleID as in yesterday's post; same message. Then I tried creating
a
query based on tblTitlesEmps referencing TitleDescription. I didn't get
the
FROM message but it didn't return any values. I know I should post the SQL
statement but I deleted it. I deleted everything that didn't return the
value
I need. I know...it isn't helpful. I going to back away from this right
now
and try again tomorrow.
--
Aria W.


Beetle said:
I believe this might be where the problem lies. Currently, it's a form.
I
was trying to make a subform based on your post yesterday, but I was
unsure
exactly what you meant. I didn't understand why this wouldn't be a
subform of
tblEmployees. You mentioned Titles (tblTitles? frmTitles?) but since I
didn't
quite understand what you meant, I tried it both ways to see if I
could get
what I think I need

It *should* be a subform in frmEmployees. It's recordsource should be
tblTitlesEmps. It should have a combo box that has EmpID (from
tblTitlesEmps)
as the control source, and the row source of this combo box should be
a SQL statement like the one I posted previously, which gets its values
from tblTitles.
BTW, I re-read all of our discussions about Titles and Classifications
and
for the life of me cannot figure out why we have this junction table,
EmpsClass. Each employee can only have one classification although many
employees can have the same classification. I think that would be 1:M.
The
only thing I remember discussing concerning dual classifications were
administrators but we were leaving them as is. I'll leave it alone for
now.

In that case, then you need a field in tblEmployees for ClassID as a FK,
since
tblEmployees would be the "many" side of the relationship. Then in your
frmEmployees you would just add a combo box that is bound to this field
(the control source), and the row source would be something like;

Select ClassID, ClassDescription From tblClassifications OrderBy
ClassDescription

Bound Column = 1
Column Count = 2
Column Widths = 0,1

You would not need tblEmpClassifications (the junction table) in this
case.


--
_________

Sean Bailey


Aria said:
frmEmployees
Record Source = tblEmployees
Default View = Single Form
Purpose = enter general info about all employees

Correct (subs and site staff).

sfrmSiteEmps (a subform of frmEmployees)
Record Source = tblSiteEmps
Default View = Single Form
Purpose = enter address and other info related to full time staff

Correct.

frmTitles (which I think is a subform in frmEmployees ?)
Record Source = tblTitlesEmps (the junction table)?
Default View = Continuous ?
Purpose = select the appropriate Title(s) for each employee ?

I believe this might be where the problem lies. Currently, it's a form.
I
was trying to make a subform based on your post yesterday, but I was
unsure
exactly what you meant. I didn't understand why this wouldn't be a
subform of
tblEmployees. You mentioned Titles (tblTitles? frmTitles?) but since I
didn't
quite understand what you meant, I tried it both ways to see if I
could get
what I think I need.

frmClassifications (which I think is also a subform in frmEmployees
?)
Record Source = tblEmpClassifications (the junction table) ?
Default View = Continuous ?
Purpose = select the appropriate Classification(s) for each employee
?

No, this is not a subform. This is a form. The combo box is part of
tblEmployees. I did not experience the error message that I received
with
cboTitles so I left it alone.

BTW, I re-read all of our discussions about Titles and Classifications
and
for the life of me cannot figure out why we have this junction table,
EmpsClass. Each employee can only have one classification although many
employees can have the same classification. I think that would be 1:M.
The
only thing I remember discussing concerning dual classifications were
administrators but we were leaving them as is. I'll leave it alone for
now.


--
Aria W.


:

OK. I would like to make sure I have a clear understanding of the
forms
you currently have. From what I can tell, you have the following;

frmEmployees
Record Source = tblEmployees
Default View = Single Form
Purpose = enter general info about all employees

sfrmSiteEmps (a subform of frmEmployees)
Record Source = tblSiteEmps
Default View = Single Form
Purpose = enter address and other info related to full time staff

frmTitles (which I think is a subform in frmEmployees ?)
Record Source = tblTitlesEmps (the junction table)?
Default View = Continuous ?
Purpose = select the appropriate Title(s) for each employee ?

frmClassifications (which I think is also a subform in frmEmployees
?)
Record Source = tblEmpClassifications (the junction table) ?
Default View = Continuous ?
Purpose = select the appropriate Classification(s) for each employee
?

Is this correct?

--
_________

Sean Bailey


:

OK, so what you need to do is use subforms for this.I'll use
Titles as an
example. The junction table (tblEmpTitles) stores the data that
defines
the relationship, so you add another subform that uses the
junction table as it's recordsource.

I'm sorry; maybe I've misunderstood... There is a combo box for
Class
Description on the form tblEmployees which contains a subform,
tblSiteEmps. I
deleted the combo box for Title Description on this form and
frmTitles. Am I
creating a new subform for frmTitles or frmEmployees?

In design view both scroll bars will appear regardless.

Yes, this is in design view. I can't see the labels and I can't
scroll to
the labels. Even when I try to re size it the result is the same. I
can
possibly delete the text box for EmpID and the label too if I catch
the tip,
but I can't see or reach the label for TitleID to change it into a
combo box
with the horizontal scroll bar in the way. I must be missing
something.

(if you're not using the wizard, just start with a combo box to
begin with);

This is on frmTitles, correct?

Not sure why that would be unless you put the subform inside a
form >that is already continuous. You can't have a continuous
subform inside >another continuous form/subform.

Other properties of the form you may want to change might be;
Default View = Continuous

I assumed you meant for me to set this property for frmTitles,
although I
may be mistaken. As far as I can see, the only one set to
continuous is
frmTitles. The other forms, frmEmployees, frmClassifications and
sfrmSiteEmps
is set to single form.

It may help if you copy and paste your row source SQL.

After I used the wizard to make the combo box it said this:

SELECT [tblTitlesEmps].[EmpID], [tblTitlesEmps].[TitleID] FROM
[tblTitlesEmps]

I then changed it to what you had which was this:
SELECT TitleID, TitleDescription From tblTitles OrderBy
TitleDescription

Hopefully, this is making sense to you.

Not yet, but I'm still trying...

Thanks for your help.



--
Aria W.


:

The horizontal bar stayed even though I had switched it to
vertical only.

Are you talking about in design view or regular form view? In
design view
both scroll bars will appear regardless.

Should I delete the other combo box we originally made. The one
that is
giving the invalid value message?

Yes

1. Form/subform can't be set to continues veiw. Microsoft will
set to single
form.

Not sure why that would be unless you put the subform inside a
form that
is already continuous. You can't have a continuous subform inside
another
continuous form/subform.

2. Syntax error in From clause. I double checked to see if I
had input
"FromtblTitles" correctly. It seem to be correct so I'm not
sure what the
problem is there.

It may help if you copy and paste your row source SQL.

My other question is about the Control Source. I'm supposed to
put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be
referenced? I'm just
trying to clarify because I don't see anything else that refers
to
tblTitlesEmps. Or will it be recorded in both places because
TitleID is a
field in both tblTitles and tblTitlesEmps?

Yes. The record source of the subform should be tblTitlesEmps and
the
control source of the combo box should be TitleID from that
table. The
appropriate TitleID from tblTitles (which comes from the *row*
source of
the combo box) will be recorded in tblTitlesEmps (via the
*control* source
of the combo box).

Hopefully, this is making sense to you.
--
_________

Sean Bailey


:

Thanks, Bruce. I finally found it. I'm still working on it but
I think I may
be getting closer. I had to make the combo box because I could
not get the
wizard to give me what I think I need. It created 2 scroll bars
(1 vertical
and 1 horizontal). I couldn't see the labels and couldn't
scroll to the
labels. The horizontal bar stayed even though I had switched it
to vertical
only. Should I delete the other combo box we originally made.
The one that is
giving the invalid value message? It's now giving me a couple
of new messages.

1. Form/subform can't be set to continues veiw. Microsoft will
set to single
form.

2. Syntax error in From clause. I double checked to see if I
had input
"FromtblTitles" correctly. It seem to be correct so I'm not
sure what the
problem is there.

My other question is about the Control Source. I'm supposed to
put "TitleID
(intblTitlesEmps)" So that table(tblTitlesEmps) will be
referenced? I'm just
trying to clarify because I don't see anything else that refers
to
tblTitlesEmps. Or will it be recorded in both places because
TitleID is a
field in both tblTitles and tblTitlesEmps?


--
Aria W.


:

I'm just sort of popping in as time permits, so this will not
be a thorough
reply. Record Selectors is a property on the Format tab of
the form's
Property Sheet. If it is Yes you will see a bar on the left
side of the
window, with an arrow pointing to the current record and an
asterisk for the
new record (in a continuous form). In a single form I think
you just see
the arrow for every record.
The drop-down list isn't in alphabetical order because you
didn't tell it to
be. In Sean's Row Source SQL there is an Order By statement.
This
determines the sort order. If you use a named query as the
Row Source there
is an Order By statement in the query. To see the query's
underlying
language (I don't recall if you know this), open the query
and click View >>
SQL.
Just to stress the point, the combo box has a Row Source,
which determines
the list the user will see when clicking the down arrow. A
combo box is a
control that may be bound to a field, so it may also have a
Control Source,
which is a field in the form's Record Source. The combo box
is not based on
tblTitles, but rather is bound to a single field in
tblTitles. When you
make a selection from the combo box, the bound column in the
combo box Row
Source is written to the field in the table. If EmployeeID
is the (hidden)
bound column, and FullName is the visible column, selecting a
name will
cause the associated EmployeeID to be stored in the combo box
Control Source
field.


I didn't give you all of the information that you requested.
The problem is
on the main form. The recordsource, I believe is tblTitles.
I think I
found
the answer to one of my problems. The drop-list isn't in
alpha order
because
the sort was based on qryTitles, but the combo box is based
on tblTitles.

--
Aria W.


:

Yes, that's correct.
--
Aria W.


:

You may need to refresh my memory a bit here. You had
m:m relationships
for Employees to Titles and Employees to
Classifications, so you have
 
A

Aria

Maybe I'm not doing much good by jumping in occasionally, but I'm going to
jump in again anyhow.

Thank you so much for your explanation. It was very helpful. Jump in
whenever you can...
Maybe you mean you are including tblTitles in the query

You're correct. When I did the query, I also pulled in tblTitles.
I suspect a disconnect with the concept of Row Source and Control Source. >Think of it this way (don't do it, but rather just picture it; this is a thought experiment only)

You're right. There is a disconnect. I understand the concept but I can't
visualize how this works. Because I can't "see" it, I'm not "getting" it. My
query made sense to me because it pulled in all the information I needed.
Your "picture this" experiment is helpful. I'm going to have to go through it
a few more times to make sure it sinks in. Thank you so much.
 
A

Aria

Just wanted you to know that I got it to work! I did as you suggested and
pushed the ellipsis button to take a look at the query. It doesn't look any
different from what I saw yesterday. I'm also not getting the message about
the From clause even though the Row Source doesn't appear different to me. I
don't know what the problem was, but I sure am happy it's working. Thank you
all!
 
B

Beetle

Just wanted you to know that I got it to work!

Do you mean the combo box for Classifications, or the subform for Titles,
or both?
 
A

Aria

The subform for Titles. Finally! I don't know what the problem was. I think I
did the same today as yesterday. I didn't have a problem with the combo box
for Classifications. The Row Source for Classifications seemed very similar
to Titles. The only thing I didn't do was "Order By Classifications" and
that's only because it had already been working before we started discussing
the subform for Titles. In the beginning, both Classifications and Titles
were combo boxes. Should I delete frmTitles? It still has the invalid value
message from yesterday.
 
B

Beetle

If frmTitles is not the subform that you are currently using, then I suppose
you can delete it if it serves no other purpose.

In your last post yesterday you listed the steps you had taken to create
the subform. Some of these steps were wrong, so just to clarify your
current subform should have the following properties;

Record Source = tblTitlesEmps
Default View = Continuous
The link between the main form and this subform should be EmpID

Also, your subform should have a combo box with the following properties;

Control Source = TitleID
Row Source = Select TitleID, TitleDescription From tblTitles
OrderBy TitleDescription
Column Count = 2
Bound Column = 1
Column Widths = 0",1" (or whatever width works best for you)
 
A

Aria via AccessMonster.com

Apparently there are problems in the Microsoft forum. I hate to break the
thread (sorry Bruce) but I was wondering if you could help me with something?
Currently, I'm working with frmEmployees. I want the form to be user-friendly.
I know there are going to be issues there. There is an example of what I want
to do in my book and I followed what they said to do, but of course it isn't
working for me. In frmEmployees I added a combo box. It's unbound; maybe it
should be bound. I did try that but it again only showed the last name. What
I'm trying to do is create a drop-down list of employee last name, first name.
When the user clicks on the name, it goes to that employee record. I added a
print record button (I don't know if it works because currently, I'm stuck on
this). I see the names in the drop-down but it isn't going to that record and
when I click on the name it then only shows the last name.
This is the SQL statement: SELECT [tblEmployees].[EmpID], [tblEmployees].
[LastName], [tblEmployees].[FirstName] FROM tblEmployees ORDER BY
[tblEmployees].[LastName], [tblEmployees].[FirstName];

The Record Source is tblEmployees. I tried to put Last name in as the control
source but Access didn't like that so I took it out. The Row Source Type is
table/query. Column count = 3
Bound Column = 1

I'm sure we've already discussed this but I not catching it. I've looked at
the query. It looks like what I want. I've also looked at it in datasheet
view. The names are there but it did not sort ascending like I asked. What
mistakes have I made and how do I fix it?
You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
junction
tables for each of them, is that correct?
[quoted text clipped - 15 lines]
 
B

BruceM

I can't figure why it isn't sorting, although I have one idea I will address
later. Try this:
SELECT [EmpID], [LastName] & ", " & [FirstName] AS LastFirst FROM
tblEmployees ORDER BY
[LastName], [FirstName];

This doesn't really address your questions in some ways, but it is an
example of how an alias (LastFirst) can be used. You didn't mention column
widths, but for a three column colmbo box in which the first column is
hidden then would be something like 0";1";1". In my example the column
count would be 2 and the column widths 0";1". From what I can tell the
rightmost visible column will fill the rest of the space in the combo box.
If there is one visible column it will be the width of the combo box unless
its width is greater than the combo box width. If the combo box is 2.5"
wide and the visible columns are 1";1" the rightmost column will actually be
1.5". If the combo box is 1.5" wide and the visible columns are 1";1" the
rightmost column will hang over the edge of the combo box when you click the
down arrow.

Anyhow, back to the combo box. In this case it should be unbound. You
aren't trying to store the value, but rather to go to the selected record.
For this the combo box needs an After Update event something like this
(cboEmployee is the name of the combo box):

Dim rs As Object

Set rs = Me.RecordsetClone
rs.FindFirst "[EmployeeID] = " & Me.cboEmployee
Me.Bookmark = rs.Bookmark

You could also do it this way:

Me.RecordsetClone.FindFirst "[EmployeeID] = " & Me.cboEmployee
Me.Bookmark = Me.RecordsetClone.Bookmark

The difference is that in the first case rs is used as a sort of
abbreviation for Me.RecordsetClone. Thereafter you use rs in place of
Me.RecordsetClone. Dim rs as Object declares rs as an object variable. I
don't want to get too deeply into this, but when you hear about variable
declaration and use, this is one example.

Back to the sorting in the combo box. Open the SQL in Design View and be
sure it is what it should be. Unless there is a lookup field in the table,
it should work. To see if there is a lookup field, open the table and see
if any of the fields have a drop-down arrow. If they do, report back about
it. It needs to be fixed.

Assuming you get the combo box to work as intended, just what action are you
performing when you print the record? Best choice would be to create a
report (it can be very simple if you like), and to print the report. It is
an easy enough matter to limit printing the report to a single selected
record.

Aria via AccessMonster.com said:
Apparently there are problems in the Microsoft forum. I hate to break the
thread (sorry Bruce) but I was wondering if you could help me with
something?
Currently, I'm working with frmEmployees. I want the form to be
user-friendly.
I know there are going to be issues there. There is an example of what I
want
to do in my book and I followed what they said to do, but of course it
isn't
working for me. In frmEmployees I added a combo box. It's unbound; maybe
it
should be bound. I did try that but it again only showed the last name.
What
I'm trying to do is create a drop-down list of employee last name, first
name.
When the user clicks on the name, it goes to that employee record. I added
a
print record button (I don't know if it works because currently, I'm stuck
on
this). I see the names in the drop-down but it isn't going to that record
and
when I click on the name it then only shows the last name.
This is the SQL statement: SELECT [tblEmployees].[EmpID], [tblEmployees].
[LastName], [tblEmployees].[FirstName] FROM tblEmployees ORDER BY
[tblEmployees].[LastName], [tblEmployees].[FirstName];

The Record Source is tblEmployees. I tried to put Last name in as the
control
source but Access didn't like that so I took it out. The Row Source Type
is
table/query. Column count = 3
Bound Column = 1

I'm sure we've already discussed this but I not catching it. I've looked
at
the query. It looks like what I want. I've also looked at it in datasheet
view. The names are there but it did not sort ascending like I asked. What
mistakes have I made and how do I fix it?
You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
junction
tables for each of them, is that correct?
I was talking specifically about tables, not forms.
[quoted text clipped - 15 lines]
gonna
start :- )
 
A

Aria

Hi Bruce,
Thanks for responding. It seemed so easy in the example. Why does everything
have to turn into a problem? I'm sorry, I forgot to include column widths. I
thought about that much later.

Column widths =0";0.6459";0.625"
List widths=1.2708"
In this case it should be unbound. You aren't trying to store the value, >but rather to go to the selected record.

I thought it should be unbound but I've been wrong so often that now I
automatically think, "You're wrong. It must be the other way."
Dim rs As Object

Set rs = Me.RecordsetClone
rs.FindFirst "[EmployeeID] = " & Me.cboEmployee
Me.Bookmark = rs.Bookmark

Hmmm...programming code. You know where I am as far as skill level. I am
certainly willing to try, if you don't mind the questions that are sure to
come. I'll try not to inundate you with a thousand and one questions.
Can I ask the following:
1. The above code goes into the AfterUpdate event as is?
The difference is that in the first case rs is used as a sort of
abbreviation for Me.RecordsetClone. Thereafter you use rs in place of
Me.RecordsetClone. Dim rs as Object declares rs as an object variable.

2. Well, maybe I don't need to know, but I was wondering if Access already
knows that rs is an abbreviation for Me.RecordsetClone because the = sign
isn't used until the second statement. If it's more than I need to know, we
can drop it.

3. Me.Bookmark--I've seen that before and have been dying to ask. What does
that do? I think of a bookmark as a placeholder, but if the value isn't
stored...?

Again, if you don't want to get into it, that's fine.

As far as the SQL statement, I opened it again in Design view and this is
what it shows:

Field: EmpID
Table:tblEmployees
Show: Yes (The box is checked).

Field:Last Name
Table:tblEmployees
Sort: Ascending
Show: Yes

Field: FirstName
Table:tblEmployees
Sort: Ascending
Show: Yes

Just want to make sure we're on the same page...I'm working in frmEmployees
with subform SiteEmps, so the table you want me to look in is tblEmployees?
Just to cover all, I checked both tables. I did not see a drop-down arrow. I
assume you mean in Design View. There is something a little odd though. I
have only input 6 employee names using frmEmployees just so I can check to
see if things are working. When I opened the table, 5 of the employees have a
title description (Admin., teacher, etc.). The sixth and final entry shows a
#...#14. I don't know why. When you open the form, it list the title.

As far as printing the record, I am just trying to circumvent some
anticipated issues; one in particular is staying in my head. As I work
through my issues with the db, I keep thinking about how others will use it.
I can hear some of the conversations already. I did think about making a
report after I created that button. The print button is convenient but I
think I would rather it go to print preview. I don't know, I'm still just
trying to get through all of my other issues.




--
Aria W.


BruceM said:
I can't figure why it isn't sorting, although I have one idea I will address
later. Try this:
SELECT [EmpID], [LastName] & ", " & [FirstName] AS LastFirst FROM
tblEmployees ORDER BY
[LastName], [FirstName];

This doesn't really address your questions in some ways, but it is an
example of how an alias (LastFirst) can be used. You didn't mention column
widths, but for a three column colmbo box in which the first column is
hidden then would be something like 0";1";1". In my example the column
count would be 2 and the column widths 0";1". From what I can tell the
rightmost visible column will fill the rest of the space in the combo box.
If there is one visible column it will be the width of the combo box unless
its width is greater than the combo box width. If the combo box is 2.5"
wide and the visible columns are 1";1" the rightmost column will actually be
1.5". If the combo box is 1.5" wide and the visible columns are 1";1" the
rightmost column will hang over the edge of the combo box when you click the
down arrow.

Anyhow, back to the combo box. In this case it should be unbound. You
aren't trying to store the value, but rather to go to the selected record.
For this the combo box needs an After Update event something like this
(cboEmployee is the name of the combo box):

Dim rs As Object

Set rs = Me.RecordsetClone
rs.FindFirst "[EmployeeID] = " & Me.cboEmployee
Me.Bookmark = rs.Bookmark

You could also do it this way:

Me.RecordsetClone.FindFirst "[EmployeeID] = " & Me.cboEmployee
Me.Bookmark = Me.RecordsetClone.Bookmark

The difference is that in the first case rs is used as a sort of
abbreviation for Me.RecordsetClone. Thereafter you use rs in place of
Me.RecordsetClone. Dim rs as Object declares rs as an object variable. I
don't want to get too deeply into this, but when you hear about variable
declaration and use, this is one example.

Back to the sorting in the combo box. Open the SQL in Design View and be
sure it is what it should be. Unless there is a lookup field in the table,
it should work. To see if there is a lookup field, open the table and see
if any of the fields have a drop-down arrow. If they do, report back about
it. It needs to be fixed.

Assuming you get the combo box to work as intended, just what action are you
performing when you print the record? Best choice would be to create a
report (it can be very simple if you like), and to print the report. It is
an easy enough matter to limit printing the report to a single selected
record.

Aria via AccessMonster.com said:
Apparently there are problems in the Microsoft forum. I hate to break the
thread (sorry Bruce) but I was wondering if you could help me with
something?
Currently, I'm working with frmEmployees. I want the form to be
user-friendly.
I know there are going to be issues there. There is an example of what I
want
to do in my book and I followed what they said to do, but of course it
isn't
working for me. In frmEmployees I added a combo box. It's unbound; maybe
it
should be bound. I did try that but it again only showed the last name.
What
I'm trying to do is create a drop-down list of employee last name, first
name.
When the user clicks on the name, it goes to that employee record. I added
a
print record button (I don't know if it works because currently, I'm stuck
on
this). I see the names in the drop-down but it isn't going to that record
and
when I click on the name it then only shows the last name.
This is the SQL statement: SELECT [tblEmployees].[EmpID], [tblEmployees].
[LastName], [tblEmployees].[FirstName] FROM tblEmployees ORDER BY
[tblEmployees].[LastName], [tblEmployees].[FirstName];

The Record Source is tblEmployees. I tried to put Last name in as the
control
source but Access didn't like that so I took it out. The Row Source Type
is
table/query. Column count = 3
Bound Column = 1

I'm sure we've already discussed this but I not catching it. I've looked
at
the query. It looks like what I want. I've also looked at it in datasheet
view. The names are there but it did not sort ascending like I asked. What
mistakes have I made and how do I fix it?
You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
junction
tables for each of them, is that correct?

I was talking specifically about tables, not forms.

[quoted text clipped - 15 lines]
gonna
start :- )
 
B

BruceM

Aria said:
Hi Bruce,
Thanks for responding. It seemed so easy in the example. Why does
everything
have to turn into a problem? I'm sorry, I forgot to include column widths.
I
thought about that much later.

Column widths =0";0.6459";0.625"
List widths=1.2708"

My mistake. It's list width that sets the overall width.
In this case it should be unbound. You aren't trying to store the value,

I thought it should be unbound but I've been wrong so often that now I
automatically think, "You're wrong. It must be the other way."
Dim rs As Object

Set rs = Me.RecordsetClone
rs.FindFirst "[EmployeeID] = " & Me.cboEmployee
Me.Bookmark = rs.Bookmark

Hmmm...programming code. You know where I am as far as skill level. I am
certainly willing to try, if you don't mind the questions that are sure to
come. I'll try not to inundate you with a thousand and one questions.
Can I ask the following:
1. The above code goes into the AfterUpdate event as is?

Use your actual control and field names, but other than that it should work
as written.
2. Well, maybe I don't need to know, but I was wondering if Access already
knows that rs is an abbreviation for Me.RecordsetClone because the = sign
isn't used until the second statement. If it's more than I need to know,
we
can drop it.

Here is a simpler example of using a variable. This is a string (text)
variable:

' This declares that when strMsg appears in the code it is to be treated as
a text string
Dim strMsg as String

' This assigns a value to the string variable we have just declared
strMsg = "You are about to change the value"

' The next two lines of code will produce the same message
MsgBox "You are about to change the value"
MsgBox strMsg

If this code is in the Before Update event for a text box the message "You
are about to change the value" will appear before the value is updated.
Using the variable can be tidier, and simplifies things when you need to use
the same text string several times. In the VBA examples in VBA Help all
values are assigned to variables. I can't say I see the benefit of that,
but it may help to understand what's going on with Help.

In my example, Dim rs As Object declares to the After Update event that rs
is an Object. I can't really describe why RecordsetClone is an Object, nor
can I clearly describe what RecordsetClone is. However, this line of code
tells the After Update event that rs is the same as Me.RecordsetClone:

Set rs = Me.RecordsetClone
3. Me.Bookmark--I've seen that before and have been dying to ask. What
does
that do? I think of a bookmark as a placeholder, but if the value isn't
stored...?

For one thing, it's very different from a Bookmark in Word. This
explanation may be a bit sketchy, but it's the best I can do. Form VBA
Help, a bookmark "uniquely identifies a particular record in the form's
underlying table". This:
rs.FindFirst "[EmployeeID] = " & Me.cboEmployee
identifies a particular record in the form's record source. A bookmark is
assigned to each record in the Record Source table or query. RecordsetClone
is a copy of the Recordset, so it has the same bookmarks. RecordsetClone
lets you perform actions such as Find that cannot be performed on the form.
Once the particular record you selected is identified in the copy
(RecordsetClone), Me.Bookmark = rs.Bookmark goes to the record with the same
bookmark as the one that was found in the RecordsetClone.
That's the best I can do with that one.
Again, if you don't want to get into it, that's fine.

As far as the SQL statement, I opened it again in Design view and this is
what it shows:

Field: EmpID
Table:tblEmployees
Show: Yes (The box is checked).

Field:Last Name
Table:tblEmployees
Sort: Ascending
Show: Yes

Field: FirstName
Table:tblEmployees
Sort: Ascending
Show: Yes

Just want to make sure we're on the same page...I'm working in
frmEmployees
with subform SiteEmps, so the table you want me to look in is
tblEmployees?
Just to cover all, I checked both tables. I did not see a drop-down arrow.
I
assume you mean in Design View. There is something a little odd though. I
have only input 6 employee names using frmEmployees just so I can check to
see if things are working. When I opened the table, 5 of the employees
have a
title description (Admin., teacher, etc.). The sixth and final entry shows
a
#...#14. I don't know why. When you open the form, it list the title.

Yes, look in tblEmployees if that contains the records that are not sorting
properly. Regarding the drop-down arrow, I meant in datasheet view. It
will show up when you click into the field. In Design view, the Lookup tab
at the bottom of the window will show "Combo Box". I couldn't say what is
going on with #...#14.
As far as printing the record, I am just trying to circumvent some
anticipated issues; one in particular is staying in my head. As I work
through my issues with the db, I keep thinking about how others will use
it.
I can hear some of the conversations already. I did think about making a
report after I created that button. The print button is convenient but I
think I would rather it go to print preview. I don't know, I'm still just
trying to get through all of my other issues.

You can preview the report with something like this:
DoCmd.OpenReport "ReportName", acViewPreview

The menu bar or toolbar can contain the print command or icon.
--
Aria W.


BruceM said:
I can't figure why it isn't sorting, although I have one idea I will
address
later. Try this:
SELECT [EmpID], [LastName] & ", " & [FirstName] AS LastFirst FROM
tblEmployees ORDER BY
[LastName], [FirstName];

This doesn't really address your questions in some ways, but it is an
example of how an alias (LastFirst) can be used. You didn't mention
column
widths, but for a three column colmbo box in which the first column is
hidden then would be something like 0";1";1". In my example the column
count would be 2 and the column widths 0";1". From what I can tell the
rightmost visible column will fill the rest of the space in the combo
box.
If there is one visible column it will be the width of the combo box
unless
its width is greater than the combo box width. If the combo box is 2.5"
wide and the visible columns are 1";1" the rightmost column will actually
be
1.5". If the combo box is 1.5" wide and the visible columns are 1";1"
the
rightmost column will hang over the edge of the combo box when you click
the
down arrow.

Anyhow, back to the combo box. In this case it should be unbound. You
aren't trying to store the value, but rather to go to the selected
record.
For this the combo box needs an After Update event something like this
(cboEmployee is the name of the combo box):

Dim rs As Object

Set rs = Me.RecordsetClone
rs.FindFirst "[EmployeeID] = " & Me.cboEmployee
Me.Bookmark = rs.Bookmark

You could also do it this way:

Me.RecordsetClone.FindFirst "[EmployeeID] = " & Me.cboEmployee
Me.Bookmark = Me.RecordsetClone.Bookmark

The difference is that in the first case rs is used as a sort of
abbreviation for Me.RecordsetClone. Thereafter you use rs in place of
Me.RecordsetClone. Dim rs as Object declares rs as an object variable.
I
don't want to get too deeply into this, but when you hear about variable
declaration and use, this is one example.

Back to the sorting in the combo box. Open the SQL in Design View and be
sure it is what it should be. Unless there is a lookup field in the
table,
it should work. To see if there is a lookup field, open the table and
see
if any of the fields have a drop-down arrow. If they do, report back
about
it. It needs to be fixed.

Assuming you get the combo box to work as intended, just what action are
you
performing when you print the record? Best choice would be to create a
report (it can be very simple if you like), and to print the report. It
is
an easy enough matter to limit printing the report to a single selected
record.

Aria via AccessMonster.com said:
Apparently there are problems in the Microsoft forum. I hate to break
the
thread (sorry Bruce) but I was wondering if you could help me with
something?
Currently, I'm working with frmEmployees. I want the form to be
user-friendly.
I know there are going to be issues there. There is an example of what
I
want
to do in my book and I followed what they said to do, but of course it
isn't
working for me. In frmEmployees I added a combo box. It's unbound;
maybe
it
should be bound. I did try that but it again only showed the last name.
What
I'm trying to do is create a drop-down list of employee last name,
first
name.
When the user clicks on the name, it goes to that employee record. I
added
a
print record button (I don't know if it works because currently, I'm
stuck
on
this). I see the names in the drop-down but it isn't going to that
record
and
when I click on the name it then only shows the last name.
This is the SQL statement: SELECT [tblEmployees].[EmpID],
[tblEmployees].
[LastName], [tblEmployees].[FirstName] FROM tblEmployees ORDER BY
[tblEmployees].[LastName], [tblEmployees].[FirstName];

The Record Source is tblEmployees. I tried to put Last name in as the
control
source but Access didn't like that so I took it out. The Row Source
Type
is
table/query. Column count = 3
Bound Column = 1

I'm sure we've already discussed this but I not catching it. I've
looked
at
the query. It looks like what I want. I've also looked at it in
datasheet
view. The names are there but it did not sort ascending like I asked.
What
mistakes have I made and how do I fix it?

Beetle284 wrote:
You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
junction
tables for each of them, is that correct?

I was talking specifically about tables, not forms.

[quoted text clipped - 15 lines]
gonna
start :- )
 
B

Beetle

Several questions to address here, so comments are inline.
Dim rs As Object

Set rs = Me.RecordsetClone
rs.FindFirst "[EmployeeID] = " & Me.cboEmployee
Me.Bookmark = rs.Bookmark

Hmmm...programming code. You know where I am as far as skill level. I am
certainly willing to try, if you don't mind the questions that are sure to
come. I'll try not to inundate you with a thousand and one questions.
Can I ask the following:
1. The above code goes into the AfterUpdate event as is?

Yes, but you may need to correct the naming. For example, I believe
you PK field is EmpID (not EmployeeID), and your combo box may
have a different name.
2. Well, maybe I don't need to know, but I was wondering if Access already
knows that rs is an abbreviation for Me.RecordsetClone because the = sign
isn't used until the second statement. If it's more than I need to know, we
can drop it.

No, Access doesn't already know that rs is an abbreviation for
RecordsetClone. In this line;

Dim rs As Object

you are declaring a variable named rs and telling Access what *type* of
variable it is. In this case it is an Object type of variable.

In this line;

Set rs = Me.RecordsetClone

you are telling Access what to assign to the rs variable you just declared.
In this case you are telling it to assign a copy of the recordset (table) that
your form is based on.

You can declare anything you want, as long as you declare it properly so
that Access knows what it is. In other words, you could (theoretically) write;

Dim ClownShoes As Object

Set ClownShoes = Me.RecordsetClone
ClownShoes.FindFirst "[EmployeeID] = " & Me.cboEmployee
Me.Bookmark = ClownShoes.Bookmark

but that would be silly <g>

When declaring a recordset variable, rs and rst are more or less universally
recognized (by application designers and such) as representing a recordset
of some type.
3. Me.Bookmark--I've seen that before and have been dying to ask. What does
that do? I think of a bookmark as a placeholder, but if the value isn't
stored...?

It is a placeholder of sorts, but it has nothing to do with the actual data
that
is stored in your table. Everytime you open a bound form, a unique bookmark
is created for each record in that form's recordset. The bookmarks are only
valid for the period of time that the form is open. If you close and re-open
the form, those same records may have a different bookmark assigned.
Field: EmpID
Table:tblEmployees
Show: Yes (The box is checked).

Field:Last Name
Table:tblEmployees
Sort: Ascending
Show: Yes

Field: FirstName
Table:tblEmployees
Sort: Ascending
Show: Yes

Just want to make sure we're on the same page...I'm working in frmEmployees
with subform SiteEmps, so the table you want me to look in is tblEmployees?

You have to look in tblEmployees, because FirstName and LastName don't
exist in any of your other tables. Your query looks fine, unless you want to
show both names in the combo when it is not expanded (dopped down).
A combo box will only display the first visible column in its unexpanded
state, so in that case you would need to concantenate the names in your
query as Bruce suggested. His example query might look like this in
design view;

Field: EmpID
Table:tblEmployees
Show: Yes (The box is checked).

Field:LastFirst:[LastName] & ", " & [FirstName]
Table:
Sort:
Show: Yes

Field: LastName
Table:tblEmployees
Sort: Ascending
Show: No

The last field is not shown because it is only used for sorting.
There is something a little odd though. I
have only input 6 employee names using frmEmployees just so I can check to
see if things are working. When I opened the table, 5 of the employees have a
title description (Admin., teacher, etc.). The sixth and final entry shows a
#...#14.

When you opened which table?
As far as printing the record, I am just trying to circumvent some
anticipated issues; one in particular is staying in my head. As I work
through my issues with the db, I keep thinking about how others will use it.
I can hear some of the conversations already. I did think about making a
report after I created that button. The print button is convenient but I
think I would rather it go to print preview. I don't know, I'm still just
trying to get through all of my other issues.

Although you *can* print a form in Access, they are not designed to be
printed and usually look like *&%! when you do. You should create a report
and then use a command button on your form to print (or print preview) it.

--
_________

Sean Bailey


Aria said:
Hi Bruce,
Thanks for responding. It seemed so easy in the example. Why does everything
have to turn into a problem? I'm sorry, I forgot to include column widths. I
thought about that much later.

Column widths =0";0.6459";0.625"
List widths=1.2708"
In this case it should be unbound. You aren't trying to store the value, >but rather to go to the selected record.

I thought it should be unbound but I've been wrong so often that now I
automatically think, "You're wrong. It must be the other way."
Dim rs As Object

Set rs = Me.RecordsetClone
rs.FindFirst "[EmployeeID] = " & Me.cboEmployee
Me.Bookmark = rs.Bookmark

Hmmm...programming code. You know where I am as far as skill level. I am
certainly willing to try, if you don't mind the questions that are sure to
come. I'll try not to inundate you with a thousand and one questions.
Can I ask the following:
1. The above code goes into the AfterUpdate event as is?
The difference is that in the first case rs is used as a sort of
abbreviation for Me.RecordsetClone. Thereafter you use rs in place of
Me.RecordsetClone. Dim rs as Object declares rs as an object variable.

2. Well, maybe I don't need to know, but I was wondering if Access already
knows that rs is an abbreviation for Me.RecordsetClone because the = sign
isn't used until the second statement. If it's more than I need to know, we
can drop it.

3. Me.Bookmark--I've seen that before and have been dying to ask. What does
that do? I think of a bookmark as a placeholder, but if the value isn't
stored...?

Again, if you don't want to get into it, that's fine.

As far as the SQL statement, I opened it again in Design view and this is
what it shows:

Field: EmpID
Table:tblEmployees
Show: Yes (The box is checked).

Field:Last Name
Table:tblEmployees
Sort: Ascending
Show: Yes

Field: FirstName
Table:tblEmployees
Sort: Ascending
Show: Yes

Just want to make sure we're on the same page...I'm working in frmEmployees
with subform SiteEmps, so the table you want me to look in is tblEmployees?
Just to cover all, I checked both tables. I did not see a drop-down arrow. I
assume you mean in Design View. There is something a little odd though. I
have only input 6 employee names using frmEmployees just so I can check to
see if things are working. When I opened the table, 5 of the employees have a
title description (Admin., teacher, etc.). The sixth and final entry shows a
#...#14. I don't know why. When you open the form, it list the title.

As far as printing the record, I am just trying to circumvent some
anticipated issues; one in particular is staying in my head. As I work
through my issues with the db, I keep thinking about how others will use it.
I can hear some of the conversations already. I did think about making a
report after I created that button. The print button is convenient but I
think I would rather it go to print preview. I don't know, I'm still just
trying to get through all of my other issues.




--
Aria W.


BruceM said:
I can't figure why it isn't sorting, although I have one idea I will address
later. Try this:
SELECT [EmpID], [LastName] & ", " & [FirstName] AS LastFirst FROM
tblEmployees ORDER BY
[LastName], [FirstName];

This doesn't really address your questions in some ways, but it is an
example of how an alias (LastFirst) can be used. You didn't mention column
widths, but for a three column colmbo box in which the first column is
hidden then would be something like 0";1";1". In my example the column
count would be 2 and the column widths 0";1". From what I can tell the
rightmost visible column will fill the rest of the space in the combo box.
If there is one visible column it will be the width of the combo box unless
its width is greater than the combo box width. If the combo box is 2.5"
wide and the visible columns are 1";1" the rightmost column will actually be
1.5". If the combo box is 1.5" wide and the visible columns are 1";1" the
rightmost column will hang over the edge of the combo box when you click the
down arrow.

Anyhow, back to the combo box. In this case it should be unbound. You
aren't trying to store the value, but rather to go to the selected record.
For this the combo box needs an After Update event something like this
(cboEmployee is the name of the combo box):

Dim rs As Object

Set rs = Me.RecordsetClone
rs.FindFirst "[EmployeeID] = " & Me.cboEmployee
Me.Bookmark = rs.Bookmark

You could also do it this way:

Me.RecordsetClone.FindFirst "[EmployeeID] = " & Me.cboEmployee
Me.Bookmark = Me.RecordsetClone.Bookmark

The difference is that in the first case rs is used as a sort of
abbreviation for Me.RecordsetClone. Thereafter you use rs in place of
Me.RecordsetClone. Dim rs as Object declares rs as an object variable. I
don't want to get too deeply into this, but when you hear about variable
declaration and use, this is one example.

Back to the sorting in the combo box. Open the SQL in Design View and be
sure it is what it should be. Unless there is a lookup field in the table,
it should work. To see if there is a lookup field, open the table and see
if any of the fields have a drop-down arrow. If they do, report back about
it. It needs to be fixed.

Assuming you get the combo box to work as intended, just what action are you
performing when you print the record? Best choice would be to create a
report (it can be very simple if you like), and to print the report. It is
an easy enough matter to limit printing the report to a single selected
record.

Aria via AccessMonster.com said:
Apparently there are problems in the Microsoft forum. I hate to break the
thread (sorry Bruce) but I was wondering if you could help me with
something?
Currently, I'm working with frmEmployees. I want the form to be
user-friendly.
I know there are going to be issues there. There is an example of what I
want
to do in my book and I followed what they said to do, but of course it
isn't
working for me. In frmEmployees I added a combo box. It's unbound; maybe
it
should be bound. I did try that but it again only showed the last name.
What
I'm trying to do is create a drop-down list of employee last name, first
name.
When the user clicks on the name, it goes to that employee record. I added
a
print record button (I don't know if it works because currently, I'm stuck
on
this). I see the names in the drop-down but it isn't going to that record
and
when I click on the name it then only shows the last name.
This is the SQL statement: SELECT [tblEmployees].[EmpID], [tblEmployees].
[LastName], [tblEmployees].[FirstName] FROM tblEmployees ORDER BY
[tblEmployees].[LastName], [tblEmployees].[FirstName];

The Record Source is tblEmployees. I tried to put Last name in as the
control
source but Access didn't like that so I took it out. The Row Source Type
is
table/query. Column count = 3
Bound Column = 1

I'm sure we've already discussed this but I not catching it. I've looked
at
the query. It looks like what I want. I've also looked at it in datasheet
view. The names are there but it did not sort ascending like I asked. What
mistakes have I made and how do I fix it?

Beetle284 wrote:
You may need to refresh my memory a bit here. You had m:m relationships
for Employees to Titles and Employees to Classifications, so you have
junction
tables for each of them, is that correct?

I was talking specifically about tables, not forms.

[quoted text clipped - 15 lines]
gonna
start :- )
 

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

Top