Results 1 to 5 of 5
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Linked Tables and Query Design Question

    If I have the relationships right in the relationship window, when I go to create a query and use the 2 tables linked, it links them together and the query should work correct? This is NOT the case right now. Query wont work right. The only other common field they have is bank which is in both tables as well. bankid is also in both tables and why I chose it. Only other option is to use RegID ??? I need info out of the TBanks table to be used in the query for the check registry. Error it causes when I add the TBanks tables is a field becomes uneditable.




    Query for the check registry that uses table TReg is a union query that adds a 3rd table into play.

    Table TReg


    1. RegID Primary Key
    2. bankid number
    3. bank text

    Table TBanks

    1.bankid Primary Key
    2. Bank text


    Table TReg with a primary key of RegID and table TBanks with a primary key of bankid . TReg is used for a check registry and TBanks is used for bank info.
    Right now I have them linked by bankid on a one to many relationship.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    ...and the query should work correct? This is NOT the case right now. Query wont work right.
    Can't say.... You didn't post the SQL of the query or post what the error message is. What do you mean "doesn't "work right"?

    Remove "3. bank text" from table TReg.
    Because the two tables are linked (related) by "bankID", the bank text is available.

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Here is the error message

    I cant remove that field, it is used in a append query for my check register. I am using a complex scheduler to schedule events and then have them entered into my check register and so you wont have the same fields, names, etc.. in the tables and hence the needed like field names in both tables. Here is the sql of the query being used for the check register.


    SELECT IIf([Void]=2,[debit]) AS ExpCLr, IIf(([Void]=1),[debit],0) AS ExpNotCLr, IIf(([Void]=3),[debit],0) AS ExpVoided, QRegA.debit, ConvertCurrencyToEnglish([debit]) AS ExpDebit, QRegA.credit, QRegA.RegID, QRegA.Amount, QRegA.BalDate, QRegA.ClrBank, QRegA.Account, QRegA.Void, Switch([Void]=1,"",[Void]=2,"Cleared Bank",[Void]=3,"Voided") AS ExpVoid, QRegA.ChkNo, QRegA.Memo, QRegA.Payee, QRegA.MYDate, QRegA.RegisterDte, QRegA.frequency, QRegA.frequencyamount, QRegA.scheduleddte, QRegA.freqpayee, QRegA.TransType, QRegA.PeriodTypeID, QRegA.EventStart, QRegA.Employee, QRegA.Bank, QRegA.BankID, QRegA.EventID
    FROM QRegA
    ORDER BY QRegA.BalDate, QRegA.Bank;



    Error occurs when adding the TBanks table to the query above. It shows up on the form when you try and use it.
    Attached Thumbnails Attached Thumbnails RecordsetNotUpdateable.jpg  
    Last edited by burrina; 01-06-2013 at 12:06 AM. Reason: Error Message Pic

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    uses table TReg is a union query that adds
    I missed this the first time I read it. Union Queries are not up-datable. You will have to accomplish this using a different method ....

    RE: field named "Bank" - two tables have a field named the same but hold different data??
    Don't know your structure/system, but that is bound to cause headaches

  5. #5
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Thanks, I will figure it out. It is because you don't understand how the db is structured is why! Maybe you can't get there from here, but I bet you can from there.

    Thanks,


    Just thought I would let all know I did a workaround by creating a new query,report and some code work arounds. Lesson Learned.

    When it's broke, use something else instead of trying to fix it !
    Last edited by burrina; 01-06-2013 at 01:39 AM. Reason: And I Did.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 12-05-2012, 10:42 AM
  2. Multiple linked tables query
    By cchampagne17 in forum Queries
    Replies: 3
    Last Post: 07-31-2012, 07:42 PM
  3. Linked Tables verus Query Builder
    By accessmatt in forum Access
    Replies: 5
    Last Post: 09-06-2011, 04:36 PM
  4. Basic query design question
    By megabrown in forum Queries
    Replies: 1
    Last Post: 12-15-2010, 09:10 AM
  5. Query Design Question
    By copegjc15 in forum Queries
    Replies: 7
    Last Post: 11-13-2010, 10:28 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums