473,503 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form with two tables as sources and adding info.

3 New Member
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...
Sep 6 '09 #1
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.
Sep 6 '09 #2
shayko
3 New Member
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.
Sep 6 '09 #3
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
Expand|Select|Wrap|Line Numbers
  1. Field      Type     Index
  2. WorkNumber AutoNumber  PK
  3. EmpNumber  Numeric     FK (MembersDetails)
  4. BrNumber   Numeric     FK (Branches)
  5. WorkDate   Date
  6. 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.
Sep 6 '09 #4
shayko
3 New Member
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.
Sep 6 '09 #5
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.
Sep 6 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

44
3830
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...
81
5073
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...
2
4146
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...
0
1766
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...
1
1798
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...
2
5432
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...
5
38620
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...
6
4400
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...
2
1871
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...
0
7204
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
7091
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
7282
Oralloy
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,...
1
6998
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...
0
5586
agi2029
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,...
0
3171
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...
0
1516
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 ...
1
741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
391
bsmnconsultancy
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...

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.