Sabtu, 22 Juli 2017

Re: [MS_AccessPros] New (Blank) Record button disabled

 

Khalid-


Your tables appear to be related like this:

CST Transaction  <===  Members  ===>  tblPassport

A query on those three tables will produce the Cartesian product of rows in CST Transaction and rows in tblPassport for each Member.  So for example, if a Member has 5 transactions and 3 passports, you'll get 15 rows for that Member.

That's not updatable - which would explain why you can't add a row.

John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Jul 22, 2017, at 11:36 AM, khalidtanweerburrah@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



Hi all,


I have a form "CST Participants Entry" having sub form "Data Entry CST Account Sub Form" its Record Source is query "CST Transaction Data Entry Query" having Sql:


SELECT DISTINCTROW [CST Transaction].MemberID, Members.MembershipType, Members.SurName, Members.GivenName, Members.GenderStatus, [CST Transaction].CstName, [CST Transaction].OutwardDate, [CST Transaction].OutwardDeparturePort, [CST Transaction].OutwardArrivalPort, [CST Transaction].InwardDate, [CST Transaction].InwardDeparturePort, [CST Transaction].InwardArrivalPort, Members.Working

FROM Members INNER JOIN [CST Transaction] ON Members.MemberID = [CST Transaction].MemberID

WHERE (((Members.Working)=True))


ORDER BY [CST Transaction].MemberID;


Up to here all is OK i am able to add  a new record and new record button is enabled.


The problem occurs when i try to include table "tblPassport" and its field "PassportNo" in above query, then the Sql becomes:


SELECT DISTINCTROW [CST Transaction].MemberID, Members.MembershipType, Members.SurName, Members.GivenName, Members.GenderStatus, tblPassport.PassportNo, [CST Transaction].CstName, [CST Transaction].OutwardDate, [CST Transaction].OutwardDeparturePort, [CST Transaction].OutwardArrivalPort, [CST Transaction].InwardDate, [CST Transaction].InwardDeparturePort, [CST Transaction].InwardArrivalPort, Members.Working

FROM (Members INNER JOIN [CST Transaction] ON Members.MemberID = [CST Transaction].MemberID) INNER JOIN tblPassport ON Members.MemberID = tblPassport.MemberID

WHERE (((Members.Working)=True))

ORDER BY [CST Transaction].MemberID;


In this situation i am unable to add new record. Help required please.


Regards,

Khalid

 



__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar