tab index

Hayley Baxter

Registered User.
Local time
Today, 12:38
Joined
Dec 11, 2001
Messages
1,607
I have a form based on a query. The query takes info from two tables. On my form when I click the cmdAddRecord I can type in a company name which is the first field in table1 other that the ID, this is ok because when company name is entered the id is generated BUT this is not true of the fields in table2 ie I type in the form the first field entry and the id for table2 is not generated on this field but yet it is generated on field4. I have checked the tab index and all is in order.

Anyone got any explanation for this?
 
Not too sure I am am helping here. But are your Relationships setup correctly? I had a similiar problem with autolookup, and the problem lied in the design of my tables and thier releationships.
 
Yes relationships are fine. If I was to enter something in field1 in table2 in my tables section of the db this is ok. The problem only lies in the form.
 
Are the relationships intact in your QBE grid ie match those as set out in your table relationships?

I understand your first but but I am a bit confused about the second bit

'BUT this is not true of the fields in table2 ie I type in the form the first field entry and the id for table2 is not generated on this field but yet it is generated on field4'

Are you entering a new record on a Table1 field? and is the ID in Table2 a FK to table1 or an Autonumber field?
 
Hi Fizzio

This is a one to one relationship so the id in table2 is an autonumber. I know in a one to one relationship I can infact have all the fields in the one table but there are plently of them so I thought I would have them in two tables.

Table1 - Companys, CompanyID PK
Table2 - CallCentreDetails, CallCentreID PK

I enter a company say company1 then they are given an autonumber but when I enter their call centre info the first field from this table should generate the id for the callcentreinfo but it does not generate the id until I put information into the 4rth field associated with this table.

Does that clear things up any?
 
Hi Hayley,

I'm still a bit confused. In a one-to-one, The PK in Table1 (AutoNumber) Joins to the PK in Table2 (Number-Long Integer). In your situation you seem to have a one-many relationship as CallCentreID is an Autonumber. Maybe this is where your problem is arising. In a true one-one

Companys............CallCentreDetails
-------------.......-----------------
CompanyID 1=======1 CompanyID
CompanyName.........CallCentreName
Company.............CallCentre.......

(dots just for spacing)
they are linked by the CompanyID. Can a company only have 1 call centre? Look at your structure as I'm sure this is where the problem lies.

Hope this is helpful and answers your problem

[This message has been edited by Fizzio (edited 05-29-2002).]
 
Yes that is helpful thanks, I should have realised that I had the PK in table 2 set to autonumber it should be long integer.

Thanks
 

Users who are viewing this thread

Back
Top Bottom