473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Subform/Master Form linking question

This is probably an incredibly newbie-ish question. I just haven't
had the cause to use many subforms before, so I'm pretty sure I just
don't understand it correctly (even after reading up on it).

I have a relationship set up that is used to track the hours an
employee has worked on each project during the week. I'm trying to
set up a Form to allow someone to choose their name and a Period
Ending date (basically, the tblTimeReport table), which when selected
will have the subform allow me to enter information into the Entry
table that pertains to that combination of name and date.

I'm having a nasty time trying to get it all working properly. With
some setups the subform won't allow me to enter data at all, while in
others it seems to ignore the name and date I've inputed. I have a
feeling that TimeReportID being the primary key of the tblTimeReport
table has something to do with it, but I'm not positive. I just can't
get the subform and main form to play nice.

Any help would be greatly appreciated. I've given a description of
the table below. Hopefully that's enough information for you to go
on.

* = Primary Key, + = Foreign Key

tblEmployee
EmployeeID, Autonumber*
LastName, Text
FirstName, Text
....

tblPeriodEnding
PeriodEnding, Date/Time*

tblTimeReport
TimeReportID, AutoNumber*
EmployeeID, Number+ (tblEmployee)
PeriodEnding, Date/Time+ (tblPeriodEnding)

tblEntry
EntryID, Autonumber*
TimeReportID, Number+ (tblTimeReport)
EmployeeID, Number+ (tblEmployee)
Project, Number+ (tblProject, not show here because it's not
pertinent)
MondayHours, Number
TuesdayHours, Number
WednesdayHours, Number
....
Regards,
MW
Nov 13 '05 #1
4 2283
Hi, Mason:

Consider another approach. If all you're really doing is filling in your entry
table, then make the form bound to that table. At the top of the form, have
two unbound combo boxes, the first of which lists all employees, and the second
which lists all periods. Then, in the afterupdate event of the second combo
(or perhaps in code tied to a "find the record" button), find the appropriate
record in the Entry table that has the employee and period you've chosen. If
there's no existing record, it would go to a blank record, fill in the employee
and period you've chosen, and you're off. No subforms.

This may neglect something I didn't get in my first reading of your post, but
maybe it's food for thought.

Good luck.

Jan

I have a relationship set up that is used to track the hours an
employee has worked on each project during the week. I'm trying to
set up a Form to allow someone to choose their name and a Period
Ending date (basically, the tblTimeReport table), which when selected
will have the subform allow me to enter information into the Entry
table that pertains to that combination of name and date.

I'm having a nasty time trying to get it all working properly. With
some setups the subform won't allow me to enter data at all, while in
others it seems to ignore the name and date I've inputed. I have a
feeling that TimeReportID being the primary key of the tblTimeReport
table has something to do with it, but I'm not positive. I just can't
get the subform and main form to play nice.

Any help would be greatly appreciated. I've given a description of
the table below. Hopefully that's enough information for you to go
on.

* = Primary Key, + = Foreign Key

tblEmployee
EmployeeID, Autonumber*
LastName, Text
FirstName, Text
...

tblPeriodEnding
PeriodEnding, Date/Time*

tblTimeReport
TimeReportID, AutoNumber*
EmployeeID, Number+ (tblEmployee)
PeriodEnding, Date/Time+ (tblPeriodEnding)

tblEntry
EntryID, Autonumber*
TimeReportID, Number+ (tblTimeReport)
EmployeeID, Number+ (tblEmployee)
Project, Number+ (tblProject, not show here because it's not
pertinent)
MondayHours, Number
TuesdayHours, Number
WednesdayHours, Number


Jan Stempel
Stempel Consulting
Nov 13 '05 #2
Jan,

Thanks for the advice, I'm definitely going to take it. The question
this brings up for me (probably another newbie question) is, how do I
set up a datasheet-type view of the data while keeping it looking like
a form? For example:

Employee: Bob Period Ending: 10/1/2004

Project MondayHours TusedayHours WednesdayHours
Blah 5 3 2
Foo 3 5 6

So, there could easily be multiple lines. I'd want the ability to add
a new record at the bottom while still being able to see the other
data. A datasheet view is exactly what I'm looking for, except I hate
the fact that it adds an extra line below the one you're working on.
As a side note, is there any way to stop Access from adding another
line until you hit enter on the last field?

Hopefully my questions are clear.

Thanks again,

MW

ja*****@aol.com (Janross) wrote in message news:<20***************************@mb-m27.aol.com>...
Hi, Mason:

Consider another approach. If all you're really doing is filling in your entry
table, then make the form bound to that table. At the top of the form, have
two unbound combo boxes, the first of which lists all employees, and the second
which lists all periods. Then, in the afterupdate event of the second combo
(or perhaps in code tied to a "find the record" button), find the appropriate
record in the Entry table that has the employee and period you've chosen. If
there's no existing record, it would go to a blank record, fill in the employee
and period you've chosen, and you're off. No subforms.

This may neglect something I didn't get in my first reading of your post, but
maybe it's food for thought.

Good luck.

Jan

I have a relationship set up that is used to track the hours an
employee has worked on each project during the week. I'm trying to
set up a Form to allow someone to choose their name and a Period
Ending date (basically, the tblTimeReport table), which when selected
will have the subform allow me to enter information into the Entry
table that pertains to that combination of name and date.

I'm having a nasty time trying to get it all working properly. With
some setups the subform won't allow me to enter data at all, while in
others it seems to ignore the name and date I've inputed. I have a
feeling that TimeReportID being the primary key of the tblTimeReport
table has something to do with it, but I'm not positive. I just can't
get the subform and main form to play nice.

Any help would be greatly appreciated. I've given a description of
the table below. Hopefully that's enough information for you to go
on.

* = Primary Key, + = Foreign Key

tblEmployee
EmployeeID, Autonumber*
LastName, Text
FirstName, Text
...

tblPeriodEnding
PeriodEnding, Date/Time*

tblTimeReport
TimeReportID, AutoNumber*
EmployeeID, Number+ (tblEmployee)
PeriodEnding, Date/Time+ (tblPeriodEnding)

tblEntry
EntryID, Autonumber*
TimeReportID, Number+ (tblTimeReport)
EmployeeID, Number+ (tblEmployee)
Project, Number+ (tblProject, not show here because it's not
pertinent)
MondayHours, Number
TuesdayHours, Number
WednesdayHours, Number


Jan Stempel
Stempel Consulting

Nov 13 '05 #3
> How do I
set up a datasheet-type view of the data while keeping it looking like a form? For example:

Employee: Bob Period Ending: 10/1/2004

Project MondayHours TusedayHours WednesdayHours
Blah 5 3 2
Foo 3 5 6
So, there could easily be multiple lines. I'd want the ability to add a new record at the bottom while still being able to see the other
data. A datasheet view is exactly what I'm looking for, except I hate the fact that it adds an extra line below the one you're working on.
As a side note, is there any way to stop Access from adding another
line until you hit enter on the last field?


If you're using Access 2000 or later, you could create a datasheet
subform and place it on a bound or unbound form. This may be flexible
enough to give you the solution you're after. I'm not sure you can
easily get rid of that last blank row.

Regards
Geoff
Nov 13 '05 #4
To get the equivalent of a datasheet view but with the flexibility and control
of a form, I usually set up continuous forms, with the field names in the form
header and text boxes (or combo boxes) for only the fields I need strung across
in the detail section. If necessary I sometimes put a second row below the
first, with something like a notes field.

You can't really get rid of that blank line at the bottom; it's the new record
ready to be added.

HTH

Jan
Thanks for the advice, I'm definitely going to take it. The question
this brings up for me (probably another newbie question) is, how do I
set up a datasheet-type view of the data while keeping it looking like
a form? For example:

Employee: Bob Period Ending: 10/1/2004

Project MondayHours TusedayHours WednesdayHours
Blah 5 3 2
Foo 3 5 6

So, there could easily be multiple lines. I'd want the ability to add
a new record at the bottom while still being able to see the other
data. A datasheet view is exactly what I'm looking for, except I hate
the fact that it adds an extra line below the one you're working on.
As a side note, is there any way to stop Access from adding another
line until you hit enter on the last field?

Hopefully my questions are clear.

Thanks again,

MW

ja*****@aol.com (Janross) wrote in message
news:<20***************************@mb-m27.aol.com>...
Hi, Mason:

Consider another approach. If all you're really doing is filling in your

entry
table, then make the form bound to that table. At the top of the form,

have
two unbound combo boxes, the first of which lists all employees, and the

second
which lists all periods. Then, in the afterupdate event of the second

combo
(or perhaps in code tied to a "find the record" button), find the

appropriate
record in the Entry table that has the employee and period you've chosen.

If
there's no existing record, it would go to a blank record, fill in the

employee
and period you've chosen, and you're off. No subforms.

This may neglect something I didn't get in my first reading of your post,

but
maybe it's food for thought.

Good luck.

Jan
>
>I have a relationship set up that is used to track the hours an
>employee has worked on each project during the week. I'm trying to
>set up a Form to allow someone to choose their name and a Period
>Ending date (basically, the tblTimeReport table), which when selected
>will have the subform allow me to enter information into the Entry
>table that pertains to that combination of name and date.
>
>I'm having a nasty time trying to get it all working properly. With
>some setups the subform won't allow me to enter data at all, while in
>others it seems to ignore the name and date I've inputed. I have a
>feeling that TimeReportID being the primary key of the tblTimeReport
>table has something to do with it, but I'm not positive. I just can't
>get the subform and main form to play nice.
>


Jan Stempel
Stempel Consulting
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: chrisM | last post by:
Hi, Hope someone can help me. I have the following setup in an Access database A master form 'Customers' in 'Single Form' view that has a RecordSource of 'myCustomerTable' CustomerCode...
4
by: David Gunnarsson | last post by:
I'm using Access as a front-end to a MySql database, through ODBC. I have a form set up for entering information about projects and that form has, among other things, a subform where you can...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
2
by: John | last post by:
I have two tables in a 1:M relationship- the parent has 5 fields in the primary key and the child 6 (these are actually pretty far downstream in a complicated ER model, but the problem is between...
1
by: BartonConstruction | last post by:
Greetings all, I have a main form (frmClients) with two subforms (subVisits) (subAccount). I got the subforms to reflect what the main form is showing by linking master and child fields (I...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
0
by: Mary | last post by:
I have a main form with one subform that is used to record test scores. The main form has the following fields: WratStudentID ( a combo box with 2 fields - student id and student name - . Stores...
5
by: blakerrr | last post by:
Hi everyone, I have a form called Master Order with a subform in it called Order Info. The subform has a nested subform in it called Order Details. Master Order cycles through all of the parts...
12
by: banderson | last post by:
Hello all, I am hoping that you can help me with a problem that has occurred numerous times on various forms in the two databases that I am working on. When I first add a subform to a form linking...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.