I am new on Access and currently use access 2003. I have read a few other posts already for other problems I have had and they have been very helpful, so I thought I'd post my own question as I couldn't find it in the posts..
I have two separate related tables, Contact and Company, and a form "add new contact". Contact has fields such as: ContactID, First Name, Surname, Address, City, Company ID, phone, etc. and a Main Contact field(Yes/No field).
Company has fields like:CompanyID, CompanyName, Address, City, Phone, etc, and a Main Contact field (text field).
On my "add new contact" form and "update contact" form, I have a checkbox (check if contact is main company contact).
What I would like to do is, when the checkbox is ticked, that the first name and surname of the contact on that form is automatically set into the company table under the Main Contact field.
I have tried creating a separate table called "Main Contact" with MainContactID for example, and etc. but the table will not update. I'm not sure if I am doing this the right way...
It's important for my database as each company has many contacts, and we need to identify on the company form which is the main contact.
Many thanks for your help in advance!!
Elodie
3 2674 NeoPa 32,556
Expert Mod 16PB
Maintaining your main contact information in two separate places (Contact and Customer tables) is not Normalised (See Normalisation and Table structures). This is not a good thing and I'd advise you to restructure to avoid this.
That said, looking specifically at the Contact table, you would need code to handle the situation whenever a contact is changed from or to being the Main Contact. When one is changed to Main Contact you would need code to remove this setting from whichever one previously had it set. Resetting this value should only be allowed if you have some valid logic that can determine which should be promoted in its stead. This logic would also need to be implemented in code in that case.
Importantly, in all scenarios, the first contact should always be forced to be the Main one.
Hi and thanks for your reply.
however I am not sure you have understood my question well. I do not have a Customer table but COMPANY table, and the details of the contacts are NOT stored in the company table but contact table. these two tables are linked by companyID (primary key of Company table).
In any case, I have reseolved my problem in another way
cheers
NeoPa 32,556
Expert Mod 16PB
I'm pleased you've found a way to resolve your problem, nevertheless, my earlier advice, with the proviso that I used the wrong name for your table - a pretty minor inconsistency in the circumstances - for which I apologise, still holds. Quote=emichelFACCI
What I would like to do is, when the checkbox is ticked, that the first name and surname of the contact on that form is automatically set into the company table under the Main Contact field. End Quote
Assuming the quoted text is still true, then your more recent statement that : Quote=emichelFACCI
the details of the contacts are NOT stored in the company table End Quote
seems to be contradictory. I'm not sure where that leaves us. I would just say if the former is true then this is non-normalised data. If the latter is true, then you clearly don't have that problem.
Lastly, it would be interesting to see what your solution is, bearing in mind the question is posted in a public forum. If you have the time to post it that would be appreciated.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Chris Sharman |
last post by:
I'd like to design my pages to work cooperatively with browser autofill
features.
I've loked around, but can't find any good documentation on
supported/unsupported field names...
|
by: shortbackandsides.no |
last post by:
I'm having a lot of difficulty trying to persuade the Google toolbar
autofill to act consistently, for example
=======================
<html><head>
<title>autofill test</title>
</head><body>...
|
by: David Portabella |
last post by:
Hello,
I am a doing a survey about Autofill Web Forms softwares.
Usually, they all collect information of the user once during the
set-up phase (user knowledge base).
Then, when the user...
|
by: Nick J |
last post by:
Hi,
I remember at one point access would autofill a text box when filtering by
form, Like for example as I would type it would come up with matching
records, similar to AutoComplete in Internet...
|
by: LCalaway |
last post by:
Happy 4th, all
How do you turn off the following type of autofill:
Example: I have created a table with four text fields. When entering
numeric data in these fields, by the third field, a...
|
by: Alex Sibilev |
last post by:
Hello,
I have a really weird problem I've been trying to solve it without any luck
for the last couple of hours :(
I'm writing a "conference board" application (quite similar to ASP.NET...
|
by: HTS |
last post by:
I have written a membership database application (PHP + mySQL) and need to prevent autofill from filling in fields in a member record edit form.
I know I can turn off autoFill in my browsers, I...
|
by: Sherry |
last post by:
Is there a way to automatically, or by using say a function key,
call/paste into a current table or query's field the same value entered
for the same field in the immediately preceeding record,...
|
by: Atli |
last post by:
Introduction
At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect...
|
by: tess |
last post by:
I have:
table 1 - tblLeadInfo which includes a salesman ID field
table 2 - tbllkpSalesman with all zips in the state and a Salesman
assigned to that area.
I have a form based on table #1 When...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |