Hi Guys,
It's been a while since my last access project...
I know that maybe my question will be basic for most of you, but I will be greatful to get some help dealing with it:
I need to prepare an access form that will manage work hours.
I have three tables that each has the following:
Table 1: Employee number, Name, Surname
Table 2: Brunch number, Brunch name
Table 3: All of the above + Date, Hours (in amount) - my form needs all of this.
Where is my problem:
I manage to create two combo boxes in my form. One opens the Employee numbers list and the other opens the Brunch numbers list.
I need that each combo box will automaticaly fill the related boxes e.g. when I choose Employee number 1000 it will show me also the related person.
As well as in the 2nd combo box that chooses the brunch number, I need it to show the brunch name.
Now remember, that all of the above plus the two extra boxes (date and hours) should be written to my third table...
I know its a long story written, but I'm quite sure the solution is simple... I just couldnt remember it.
Thanks to all helpers...
5 1835 NeoPa 32,557
Recognized Expert Moderator MVP
Maybe knowing what a Brunch was might enable me to make more sense of this. Currently I see no way of correlating any table with any other. Maybe Table 3 does, but I still have no idea where Date & Hours fit in.
Please could you explain also what you start with, and what you expect the form to do for you.
First, thanks for the quick response.
I will try to clarify myself...
The idea of this DB is to give the option to each employee to register his work hours thru LAN in the office without the need of filling paper reports.
Note: each employee can work in different branches so he needs to report for each one of them. Tables
Table 1 called "MembersDetails" and includes the following details in three columns:
EmpNumber (4 digits of employee number)
Name (text)
SurName (text)
Example:
1000 | John | Smith
1001 | Mary | James
2541 | Arthur | Redford
Table 2 called "Branches" and includes the following details in two columns:
BrNumber (4 digits)
BrName (text)
Example:
150 | Kitchen
164 | Warehouse
501 | Gardening
Table 3 called "HourReport" and includes the following headlines:
EmpNumber | Name | SurName | BrNumber | BrName | Date | Hours
(This is the table that should include all details from a form that includes all of the above) Form
In the form I'm trying to do the following:
1. ComboBox where the employee chooses his number (table 1) and automatically this fills the following two text boxes (name, surname) with the apropriate details.
2. ComboBox where the employee chooses his branch number (table 2) and automatically this fills the following text box (branch name).
3. Date box, where the employee chooses a date to report.
4. Text box where the employee report an amount of hours (e.g 7).
All of the above information should be saved in the 3rd table called "HourReport".
The form part is where I fail again and again of curse... :-)
Hope that's help in understanding my problem.
TNX.
NeoPa 32,557
Recognized Expert Moderator MVP
That is much clearer :)
What you need to start with is a Table 3 ( HourReport) set up with foreign keys to link into the MembersDetails & Branches tables. It is only necessary to have these fields in the table ( Table 3 == HourReport). There is no need (indeed it would be an error) to include any other fields from either of the other two tables.
Table= HourReport - Field Type Index
-
WorkNumber AutoNumber PK
-
EmpNumber Numeric FK (MembersDetails)
-
BrNumber Numeric FK (Branches)
-
WorkDate Date
-
Hours Numeric
Now, your form should have ComboBoxes for both foreign key fields. These should be fed by the data from the tables they are keys of. Once a record is selected the related data should be shown on the form, but not in bound controls. This can be done with unbound textboxes updated by code in an AfterUpdate event procedure for the ComboBox, or simply design the ComboBoxes such that the key is treated as the value but the related data is what is shown in the control when selected.
After that the rest should be simple enough. Let us know how you get on, or if you have any further questions on the matter.
TNX again for your reply!
I am most interested in unbound text boxes updated by code...
I already did those steps you mentiond and this part is very clear, but the thing is that there is a need to show complete details of each employee as he chooses his number...
You are right, there is no logical need of these details in the HourReport table, but visualy I need it. (I believe there is a way to exclude those details from being entered to the table, am I wrong?).
Hope it's not much of a trouble for you :-)
TNX.
NeoPa 32,557
Recognized Expert Moderator MVP
That is why you show it on the form, but not store it in the table.
Why don't you go as far as you can with unbound TextBoxes (Create the form; add the ComboBoxes and TextBoxes; Get it working as much as you are able), then explain where you still need help - giving details of what you've managed to do and what the names are of your objects (Form; Controls; etc), and we'll look at fleshing out the last bits for you.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Mariusz Jedrzejewski |
last post by:
Hi,
I'll be very grateful if somebody can explain me why my Opera 7.23
(runing under linux) doesn't show me inner tables. Using below code I
can see only "inner table 1". There is no problem with...
|
by: sinister |
last post by:
I wanted to spiff up my overly spartan homepage, and started using some CSS
templates I found on a couple of weblogs. It looks fine in my browser (IE
6.0), but it doesn't print right. I tested...
|
by: allyn44 |
last post by:
Hello,
I have a form that I need to transfer some of the info into a second form based on a different
query. The Id field is the same for data sources for both forms, but are based on...
|
by: Arnold |
last post by:
Hi there,
I have a form to organize bottles in mind, but am unsure if it will
work. Here's some background info:
Mainform = frmProduct, which contains fields for pricing, status, etc.
of...
|
by: Johnfcf |
last post by:
I have a database consisting of 3 tables, the main table with main
contact info, a second table with additional address info and a third
table consisting of additional contact information, or more...
| |
by: Sean |
last post by:
Greetings all,
I am attempting to make a form that will filter through several tables
that
(I believe) have refretial integrity. I am pulling data from several
tables into the form and i would...
|
by: Sami |
last post by:
I can create queries and reports based on info from one table. How do
I create one using information from multiple tables. What do I need
to make sure the information from one table will be...
|
by: Rudy |
last post by:
Hi all,
I know this is easy, just can't seem to get it. I have a windows form, and
a text box, with a value already in it. I need to add that value to a table.
It's just one value, so the entire...
|
by: erick-flores |
last post by:
Hello all
Form A (pk) & Form B (fk)
I want to display my Form B empty whenever is the first time, that the
pk form Form A, is enter. I click a button to open Form B. BUT if the
pk from Form A...
|
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,...
|
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...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |