Table relationships

K

Katie

Sorry...lost it somehow.

Anyway, your last suggestion didn't work...so I think I'm giving up. I had
wanted users to be able to select a project to view and/or update instead of
having to navigate through all the projects. But, there are only about 4
users, updates won't be all that frequent, and there are only about 30
projects. And I've reached the point of diminishing returns!

I'm sure there's a way to do it, but I know it's very difficult for you to
"see" exactly what the problem is from a distance.

In any event, thanks for all your help. I learned a lot, even if the result
isn't quite what I wanted.

Jeff Boyce said:
Sorry, I don't see a response in this thread.

Jeff

Katie said:
Jeff Boyce said:
Katie

Open the form in design mode. Highlight the combo box. Select Properties.

Find the property dealing with Column Widths. Set the first (?your ID)
column to width = 0. Now it won't show.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


Hold everything...I've been experimenting (oh-oh!)...and have made some
improvements. I left the underlying field properties (i.e. lookup tab) as
mentioned below, but did re-enter the source in the combo box properties,
thus:
Control Source: ProjectName
Row Source Type: Table/Query
Row Source: Projects (db name)
Bound Column: 2

Also, I realized I needed to make other changes to your event code, so it
now reads:
Me!txtProjectName = Me!cboCombo48.Column(2)

Things are better -- when the form opens the name of the first project
appears, and if I scroll through the projects using the "Next" button, all
is
well. However, the dropdown list contains numbers from the
"Project_Number"
column, which is the number 1 column, "Project_ID" being 0.

I've tried all kinds of combinations, but can't seem to capture the list
of
projects.


:

Hi Jeff,

I think I did what you suggested...but to clarify, here's what I
currently
have:
In the Projects combobox properties, there are no entries for
Control
Source, Row Source Type, or Row Source
I changed the Project column of the underlying table to "Text Box"
in
the Lookup tab.

Also, FYI, here is the current code for the "After Update" event -- I
wasn't
sure where to insert the code you suggested...

Private Sub Combo48_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Project_ID] = " & Str(Nz(Me![Combo48], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

Me!txtProjectName = Me!cboSelectProject.Column(2)
End Sub

At this point, in addition to the earlier problems, the Projects combo
box
no longer has a list of projects.

HELP! :)


:

Katie

One way to get a "Project Name" control to display is to use the
AfterUpdate
event of the combo box. Your code might look something like:

Me!txtProjectName = Me!cboSelectProject.Column(n)

where "n" is the n-1 column in your query (i.e., the one returning
Project
Name). Remember that .Column() is zero-based.

I suggest that you not use "lookup" data type fields in your tables.
Convert the "combo box" setting on the Lookup tab to "text".

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


Hi Jeff,

I unbound the combo box, and, yes, the underlying field is a lookup.

I no longer get the message, but when the form opens, displaying the
first
project, all the data is displayed except that the "Project Name" is
blank,
and remains blank when navigating through the forms (using "Next"
button).
 
J

Jeff Boyce

Katie

Thanks for sticking with it ... and I understand "diminishing returns"!

If the value in having this issue resolved is high enough for you, you could
consider hiring the work done, or hiring a "mentor". There may also be
college students in your area who would take on the challenge for love or
classwork...

Good luck!

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/

Katie said:
Sorry...lost it somehow.

Anyway, your last suggestion didn't work...so I think I'm giving up. I had
wanted users to be able to select a project to view and/or update instead of
having to navigate through all the projects. But, there are only about 4
users, updates won't be all that frequent, and there are only about 30
projects. And I've reached the point of diminishing returns!

I'm sure there's a way to do it, but I know it's very difficult for you to
"see" exactly what the problem is from a distance.

In any event, thanks for all your help. I learned a lot, even if the result
isn't quite what I wanted.

Jeff Boyce said:
Sorry, I don't see a response in this thread.

Jeff

Katie said:
:

Katie

Open the form in design mode. Highlight the combo box. Select Properties.

Find the property dealing with Column Widths. Set the first (?your ID)
column to width = 0. Now it won't show.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


Hold everything...I've been experimenting (oh-oh!)...and have made some
improvements. I left the underlying field properties (i.e. lookup tab) as
mentioned below, but did re-enter the source in the combo box properties,
thus:
Control Source: ProjectName
Row Source Type: Table/Query
Row Source: Projects (db name)
Bound Column: 2

Also, I realized I needed to make other changes to your event
code, so
it
now reads:
Me!txtProjectName = Me!cboCombo48.Column(2)

Things are better -- when the form opens the name of the first project
appears, and if I scroll through the projects using the "Next"
button,
all
is
well. However, the dropdown list contains numbers from the
"Project_Number"
column, which is the number 1 column, "Project_ID" being 0.

I've tried all kinds of combinations, but can't seem to capture
the
list
of
projects.


:

Hi Jeff,

I think I did what you suggested...but to clarify, here's what I
currently
have:
In the Projects combobox properties, there are no entries for
Control
Source, Row Source Type, or Row Source
I changed the Project column of the underlying table to
"Text
Box"
in
the Lookup tab.

Also, FYI, here is the current code for the "After Update"
event --
I
wasn't
sure where to insert the code you suggested...

Private Sub Combo48_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Project_ID] = " & Str(Nz(Me![Combo48], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

Me!txtProjectName = Me!cboSelectProject.Column(2)
End Sub

At this point, in addition to the earlier problems, the Projects combo
box
no longer has a list of projects.

HELP! :)


:

Katie

One way to get a "Project Name" control to display is to use the
AfterUpdate
event of the combo box. Your code might look something like:

Me!txtProjectName = Me!cboSelectProject.Column(n)

where "n" is the n-1 column in your query (i.e., the one returning
Project
Name). Remember that .Column() is zero-based.

I suggest that you not use "lookup" data type fields in your tables.
Convert the "combo box" setting on the Lookup tab to "text".

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


Hi Jeff,

I unbound the combo box, and, yes, the underlying field is a lookup.

I no longer get the message, but when the form opens,
displaying
the
first
project, all the data is displayed except that the "Project Name" is
blank,
and remains blank when navigating through the forms (using "Next"
button).
 
Top